https://github.com/codenix-sv/messari-api
Messari.io PHP REST API Client
https://github.com/codenix-sv/messari-api
api-client messari messari-api messari-client messari-php
Last synced: 9 months ago
JSON representation
Messari.io PHP REST API Client
- Host: GitHub
- URL: https://github.com/codenix-sv/messari-api
- Owner: codenix-sv
- License: mit
- Created: 2020-03-02T17:25:46.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-29T15:17:41.000Z (about 6 years ago)
- Last Synced: 2025-03-21T12:58:49.918Z (about 1 year ago)
- Topics: api-client, messari, messari-api, messari-client, messari-php
- Language: PHP
- Size: 16.6 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Messari.io PHP REST API Client
[](https://travis-ci.org/codenix-sv/messari-api)
[](https://scrutinizer-ci.com/g/codenix-sv/messari-api/?branch=master)
[](https://codeclimate.com/github/codenix-sv/messari-api/maintainability)
[](https://codeclimate.com/github/codenix-sv/messari-api/test_coverage)
[](https://github.com/codenix-sv/messari-api/blob/master/LICENSE)
A simple REST API client, written with PHP for [messari.io](https://messari.io).
Messari provides free API endpoints for thousands of crypto assets. These endpoints include trades, market data (VWAP), quantitative metrics, qualitative information. This is the same API that drives the [messari.io](https://messari.io) web app.
Most endpoints are accessible without an API key, but rate limited. This is free tier. This free tier does not include redistribution rights and requires attribution and a link back to [messari.io](https://messari.io).
Messari.io [API documentation](https://messari.io/api/docs).
## Requirements
* PHP >= 7.2
* ext-json
## Installation
The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
Either run
```bash
$ composer require codenix-sv/messari-api
```
or add
```json
"codenix-sv/messari-api": "^0.1"
```
## Basic usage
### Example
```php
use Codenixsv\MessariApi\MessariClient;
$client = new MessariClient();
$data = $client->assets()->getAll();
```
## Available methods
### Assets
#### getAll
Get the paginated list of all assets and their metrics and profiles.
```php
$data = $client->assets()->getAll();
```
#### get
Get basic metadata for an asset.
```php
$data = $client->assets()->get('btc');
```
#### getProfile
Get all of our qualitative information for an asset.
```php
$data = $client->assets()->getProfile('btc');
```
#### getMetrics
Get all of our quantitative metrics for an asset.
```php
$data = $client->assets()->getMetrics('btc');
```
#### getMarketData
Get the latest market data for an asset. This data is also included in the metrics endpoint, but if all you need is market-data, use this.
```php
$data = $client->assets()->getMarketData('btc');
```
#### getTimeseries
Retrieve historical timeseries data for an asset.
```php
$data = $client->assets()->getTimeseries('btc', 'price', ['start' => '2020-01-01', 'end' => '2020-01-07', 'interval' => '1d']);
```
### Markets
#### getAll
Get the list of all exchanges and pairs that our WebSocket-based market real-time market data API supports.
```php
$data = $client->markets()->getAll();
```
#### getTimeseries
Retrieve historical timeseries data for a market.
```php
$data = $client->markets()->getTimeseries('binance-btc-usdt', 'price', ['start' => '2020-01-01', 'end' => '2020-01-07', 'interval' => '1d']);
```
### News
#### getAll
Get the latest (paginated) news and analysis for all assets.
```php
$data = $client->news()->getAll();
```
#### GetForAsset
Get the latest (paginated) news and analysis for an asset.
```php
$data = $client->news()->getForAsset('btc');
```
## License
`codenix-sv/messari-api` is released under the MIT License. See the bundled [LICENSE](./LICENSE) for details.