PHPackages                             djansen20/bitstamp-http-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. djansen20/bitstamp-http-api

ActiveLibrary[API Development](/categories/api)

djansen20/bitstamp-http-api
===========================

Package for the implementation of the Bitstamp HTTP API

v0.5(8y ago)1101MITPHPPHP ^7.1

Since Feb 17Pushed 8y ago1 watchersCompare

[ Source](https://github.com/DJansen20/bitstamp-http-api)[ Packagist](https://packagist.org/packages/djansen20/bitstamp-http-api)[ RSS](/packages/djansen20-bitstamp-http-api/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

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

[![Minimum PHP Version](https://camo.githubusercontent.com/dcd4b4aec2c1709157fa6a2c050f709d75cde9552a79cfff0b70a97fad7281ae/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230372e312d3838393242462e7376673f7374796c653d666c61742d737175617265)](https://php.net/)

Installation
============

[](#installation)

This package can be installed using composer

```
composer require djansen20/bitstamp-http-api dev-master

```

Usage
-----

[](#usage)

In order to use this library include the following namespace into your project

```
use Bitstamp\BitstampHttpApi;
```

### Request limit

[](#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](https://www.bitstamp.net/websocket/) instead.

### Trading pair constants

[](#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:

```
use \Bitstamp\Models\CurrencyPair;
$pair = CurrencyPair::BTCUSD;
```

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

[](#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.

```
$api = BitstampHttpApi::PublicApi();
```

Now you can start requesting data from the API.

#### Daily ticker

[](#daily-ticker)

Returns ticker data of the past day. The returned object has the following properties

PropertyDescriptionlastLast ticker pricehighLast 24 hours price highlowLast 24 hours price lowvwapLast 24 hours volume weighted average pricevolumeLast 24 hours volumebidHighest buy orderaskLowest sell ordertimestampUnix timestamp date and timeopenFirst price of the dayExample request

```
$api = BitstampHttpApi::PublicApi();
$api->getDailyTicker(CurrencyPair::BTCUSD);
```

Example response

```
object(Bitstamp\PublicApi\Responses\TickerResponse)#68 (9) {
  ["high"]=>
  float(9380)
  ["last"]=>
  float(9260.99)
  ["timestamp"]=>
  int(1518634427)
  ["bid"]=>
  float(9254)
  ["vwap"]=>
  float(8986.35)
  ["volume"]=>
  float(16019.68608281)
  ["low"]=>
  float(8461.38)
  ["ask"]=>
  float(9260.93)
  ["open"]=>
  float(8504.57)
}
```

#### Hourly ticker

[](#hourly-ticker)

Returns ticker data of the past hour

PropertyDescriptionlastLast ticker pricehighLast hour price highlowLast hour price lowvwapLast hour volume weighted average pricevolumeLast hour volumebidHighest buy orderaskLowest sell ordertimestampUnix timestamp date and timeopenFirst price of the dayExample request

```
$api = BitstampHttpApi::PublicApi();
$api->getHourlyTicker(CurrencyPair::BTCUSD);
```

Example response

```
object(Bitstamp\PublicApi\Responses\HourlyTickerResponse)#31 (9) {
  ["high"]=>
  float(9380)
  ["last"]=>
  float(9312.73)
  ["timestamp"]=>
  int(1518634624)
  ["bid"]=>
  float(9300.38)
  ["vwap"]=>
  float(9307.18)
  ["volume"]=>
  float(875.26702747)
  ["low"]=>
  float(9230)
  ["ask"]=>
  float(9312.72)
  ["open"]=>
  float(9319.99)
}
```

#### Orderbook

[](#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

```
$api = BitstampHttpApi::PublicApi();
$api->getOrderBook(CurrencyPair::BTCUSD);
```

Example response

```
object(Bitstamp\PublicApi\Responses\OrderbookResponse)#48 (3) {
  ["high"]=>
  int(1518634712)
  ["bids"]=>
  array(...)
  ["asks"]=>
  array(...)
}
```

#### Transactions

[](#transactions)

Returns an object with a descending list of transaction. Every transaction array contains:

PropertyDescriptiondateUnix timestamp date and timetidTransaction IDpriceBTC priceamountBTC amounttype0 (buy) or 1 (sell)Example request

```
$api = BitstampHttpApi::PublicApi();
$api->getTransactions(CurrencyPair::BCHEUR, minute);
```

Example response

```
object(Bitstamp\PublicApi\Responses\TransactionsResponse)#68 (1) {
  ["transactions"]=>
  array(2) {
    [0]=>
    array(5) {
      ["date"]=>
      string(10) "1518635036"
      ["tid"]=>
      string(8) "54709960"
      ["price"]=>
      string(7) "1080.00"
      ["type"]=>
      string(1) "0"
      ["amount"]=>
      string(10) "0.12830413"
    }
    [1]=>
    array(5) {
      ["date"]=>
      string(10) "1518635033"
      ["tid"]=>
      string(8) "54709957"
      ["price"]=>
      string(7) "1080.00"
      ["type"]=>
      string(1) "0"
      ["amount"]=>
      string(10) "0.01508434"
    }
  }
}
```

#### Get trading pairs

[](#get-trading-pairs)

Returns an object with a list of trading pairs. Every trading pair array contains

PropertyDescriptionurl\_symbolURL symbol of trading pairbase\_decimalsDecimal precision for base currency (BTC/USD - base: BTC)counter\_decimalsDecimal precision for counter currency (BTC/USD - counter: USD)minimum\_orderMinimum order sizetradingTrading engine status (Enabled/Disabled)descriptionTrading pair descriptionExample request

```
$api = BitstampHttpApi::PublicApi();
$api->getTradingPairInfo();
```

Example response

```
object(Bitstamp\PublicApi\Responses\TradingPairsInfoResponse)#31 (1) {
  ["tradingPairs"]=>
  array(15) {
    [0]=>
    array(7) {
      ["base_decimals"]=>
      int(8)
      ["minimum_order"]=>
      string(7) "5.0 USD"
      ["name"]=>
      string(7) "LTC/USD"
      ["counter_decimals"]=>
      int(2)
      ["trading"]=>
      string(7) "Enabled"
      ["url_symbol"]=>
      string(6) "ltcusd"
      ["description"]=>
      string(22) "Litecoin / U.S. dollar"
    }
    [1]=>
    array(7) {
      ["base_decimals"]=>
      int(8)
      ["minimum_order"]=>
      string(7) "5.0 USD"
      ["name"]=>
      string(7) "ETH/USD"
      ["counter_decimals"]=>
      int(2)
      ["trading"]=>
      string(7) "Enabled"
      ["url_symbol"]=>
      string(6) "ethusd"
      ["description"]=>
      string(19) "Ether / U.S. dollar"
    }
    ...
  }
}
```

#### EUR / USD conversion rate

[](#eur--usd-conversion-rate)

Check the current EUR / USD conversion rate

Example request

```
$api = BitstampHttpApi::PublicApi();
$api->getEurUsdConversionRate();
```

Example response

```
object(Bitstamp\PublicApi\Responses\EurUsdConversionRateResponse)#63 (2) {
  ["buy"]=>
  float(1.2369)
  ["sell"]=>
  float(1.2267)
}
```

### Private methods

[](#private-methods)

To be implemented

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3008d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/cc550ea235fed94ad7c43704404a6de0ea33f1dd218a070eda54896ee95e3cf4?d=identicon)[Djansen20](/maintainers/Djansen20)

---

Top Contributors

[![DJansen20](https://avatars.githubusercontent.com/u/19436015?v=4)](https://github.com/DJansen20 "DJansen20 (34 commits)")[![NielsH](https://avatars.githubusercontent.com/u/848114?v=4)](https://github.com/NielsH "NielsH (2 commits)")

---

Tags

api-clientbitstampcryptocurrency-exchangesexchangeapibitstamp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/djansen20-bitstamp-http-api/health.svg)

```
[![Health](https://phpackages.com/badges/djansen20-bitstamp-http-api/health.svg)](https://phpackages.com/packages/djansen20-bitstamp-http-api)
```

###  Alternatives

[m165437/laravel-blueprint-docs

API Blueprint Renderer for Laravel

22779.0k](/packages/m165437-laravel-blueprint-docs)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
