Download the PHP package djansen20/bitstamp-http-api without Composer
On this page you can find all versions of the php package djansen20/bitstamp-http-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package bitstamp-http-api
Bitstamp HTTP API
This package is for communicating with the API of Bitstamp
For now the implementation only has the public methods exposed but will contain the private methods in the future
Installation
This package can be installed using composer
Usage
In order to use this library include the following namespace into your project
Request limit
Bitstamp has implemented a request limit to prevent one IP flooding their servers. When using this package make sure you limit your calls to 600 requests per 10 minutes. Or risk getting your IP banned.
If you wish to use this API for real time data please refer to Bitstamp's websocket API instead.
Trading pair constants
Most API calls require you to provide a trading pair you wish to address. You can make use of the CurrencyPair class constants to get the right strings you need to pass to a method. Example:
If you do not wish to use the CurrencyPair constants you need to provide a valid trading pair in the form of a lowercase string.
Public methods
This package allows you to use the public API without supplying account credentials. To retrieve an instance of the public API call the following method.
Now you can start requesting data from the API.
Daily ticker
Returns ticker data of the past day. The returned object has the following properties
Property | Description |
---|---|
last | Last ticker price |
high | Last 24 hours price high |
low | Last 24 hours price low |
vwap | Last 24 hours volume weighted average price |
volume | Last 24 hours volume |
bid | Highest buy order |
ask | Lowest sell order |
timestamp | Unix timestamp date and time |
open | First price of the day |
Example request
Example response
Hourly ticker
Returns ticker data of the past hour
Property | Description |
---|---|
last | Last ticker price |
high | Last hour price high |
low | Last hour price low |
vwap | Last hour volume weighted average price |
volume | Last hour volume |
bid | Highest buy order |
ask | Lowest sell order |
timestamp | Unix timestamp date and time |
open | First price of the day |
Example request
Example response
Orderbook
Returns an object with "bids" and "asks". Each is a list of open orders and each order is represented as a list holding the price and the amount.
Example request
Example response
Transactions
Returns an object with a descending list of transaction. Every transaction array contains:
Property | Description |
---|---|
date | Unix timestamp date and time |
tid | Transaction ID |
price | BTC price |
amount | BTC amount |
type | 0 (buy) or 1 (sell) |
Example request
Example response
Get trading pairs
Returns an object with a list of trading pairs. Every trading pair array contains
Property | Description |
---|---|
url_symbol | URL symbol of trading pair |
base_decimals | Decimal precision for base currency (BTC/USD - base: BTC) |
counter_decimals | Decimal precision for counter currency (BTC/USD - counter: USD) |
minimum_order | Minimum order size |
trading | Trading engine status (Enabled/Disabled) |
description | Trading pair description |
Example request
Example response
EUR / USD conversion rate
Check the current EUR / USD conversion rate
Example request
Example response
Private methods
To be implemented
License
This project is licensed under the MIT License - see the LICENSE.md file for details