codenix-sv/messari-api

PHP REST API client for messari.io

v0.1.0 2020-03-18 13:01 UTC

This package is auto-updated.

Last update: 2024-11-29 06:10:35 UTC


README

Build Status Scrutinizer Code Quality Maintainability Test Coverage License: MIT

A simple REST API client, written with PHP for 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 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.

Messari.io API documentation.

Requirements

  • PHP >= 7.2
  • ext-json

Installation

The preferred way to install this extension is through composer.

Either run

$ composer require codenix-sv/messari-api

or add

"codenix-sv/messari-api": "^0.1"

Basic usage

Example

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.

$data = $client->assets()->getAll();

get

Get basic metadata for an asset.

$data = $client->assets()->get('btc');

getProfile

Get all of our qualitative information for an asset.

$data = $client->assets()->getProfile('btc');

getMetrics

Get all of our quantitative metrics for an asset.

$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.

$data = $client->assets()->getMarketData('btc');

getTimeseries

Retrieve historical timeseries data for an asset.

$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.

$data = $client->markets()->getAll();

getTimeseries

Retrieve historical timeseries data for a market.

$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.

$data = $client->news()->getAll();

GetForAsset

Get the latest (paginated) news and analysis for an asset.

$data = $client->news()->getForAsset('btc');

License

codenix-sv/messari-api is released under the MIT License. See the bundled LICENSE for details.