Getting started overview

Getting started with the Messari API provides programmatic access to cryptocurrency market data, on-chain metrics, and fundamental asset information. The process involves creating a Messari account, generating an API key, and then using this key to authenticate requests to various API endpoints. Messari offers different tiers of access, beginning with a free Basic plan that provides limited data, with more extensive data available through paid Pro or Enterprise subscriptions.

The Messari API is designed to support developers and analysts requiring structured, up-to-date information on digital assets. It follows a RESTful architecture, typically returning data in JSON format, which aligns with common web API standards for ease of integration. Understanding HTTP methods, request headers, and JSON parsing is beneficial for efficient use of the API.

Quick Reference: Messari API Onboarding

Step What to Do Where
1. Create Account Register for a Messari account. Messari Homepage
2. Obtain API Key Locate and copy your unique API key from the dashboard. Messari Account Dashboard
3. Review API Docs Familiarize yourself with available endpoints and data models. Messari API Documentation
4. Make First Request Construct and send an authenticated HTTP GET request. CLI (cURL), Postman, or custom code
5. Parse Response Extract and interpret the JSON data returned. Your application logic

Create an account and get keys

To begin using the Messari API, you must first create an account on the Messari platform. This account serves as your central point for managing subscriptions, viewing usage, and, critically, generating your API key.

  1. Navigate to the Messari Website: Open your web browser and go to messari.io.
  2. Sign Up: Look for a "Sign Up" or "Get Started Free" button, typically located in the top right corner. Click this to initiate the account creation process.
  3. Provide Information: You will be prompted to enter an email address and create a password. You may also need to agree to terms of service and privacy policies.
  4. Verify Email: After submitting your details, Messari will send a verification email to the address you provided. Follow the instructions in this email to activate your account.
  5. Log In: Once your email is verified, log in to your newly created Messari account.
  6. Access API Key: Upon logging in, navigate to your account dashboard or settings. There should be a dedicated section for "API Keys" or "Developer Settings." Your unique API key will be displayed here. Copy this key immediately and store it securely, as it is essential for authenticating all your API requests. Avoid embedding this key directly into client-side code or public repositories.

Messari API keys are typically long, alphanumeric strings. They function as a credential to verify your authorization to access Messari's data services. The level of data access you receive will correspond to your subscription tier (Basic, Pro, or Enterprise).

Your first request

After obtaining your API key, you can make your first request to the Messari API. This example demonstrates fetching a list of all supported assets using cURL, a common command-line tool for making HTTP requests, illustrating a basic HTTP GET request with an API key parameter.

Endpoint: /api/v2/assets (Messari list all assets documentation)

This endpoint retrieves basic information for all available crypto assets supported by Messari.

Example cURL Request

curl -X GET \
  'https://data.messari.io/api/v2/assets?fields=id,symbol,name,metrics/market_data/price_usd' \
  -H 'x-messari-api-key: YOUR_API_KEY'

Replace YOUR_API_KEY with the actual API key you generated from your Messari dashboard.

Understanding the Request:

  • -X GET: Specifies the HTTP GET method, used for retrieving data.
  • 'https://data.messari.io/api/v2/assets?fields=id,symbol,name,metrics/market_data/price_usd': This is the request URL.
    • https://data.messari.io: The base URL for the Messari data API.
    • /api/v2/assets: The specific endpoint for listing assets.
    • ?fields=id,symbol,name,metrics/market_data/price_usd: A query parameter to specify the exact fields to return. This helps optimize bandwidth and only retrieves necessary data.
  • -H 'x-messari-api-key: YOUR_API_KEY': This sets an HTTP header. The x-messari-api-key header is where your API key is passed for authentication.

Expected JSON Response (partial example):

{
  "status": {
    "elapsed": 10,
    "timestamp": "2023-10-27T10:00:00.000Z"
  },
  "data": [
    {
      "id": "1e31218a-f0b4-4b5c-a570-552be4255725",
      "symbol": "BTC",
      "name": "Bitcoin",
      "metrics": {
        "market_data": {
          "price_usd": 65000.00
        }
      }
    },
    {
      "id": "d55c70a9-251c-4b58-8547-d5d4d5e75294",
      "symbol": "ETH",
      "name": "Ethereum",
      "metrics": {
        "market_data": {
          "price_usd": 3800.00
        }
      }
    }
    // ... more assets
  ]
}

This response indicates a successful call, returning an array of asset objects, each containing the requested id, symbol, name, and price_usd within the metrics/market_data field. The status object provides metadata about the request itself. Successfully receiving a similar JSON structure confirms your API key is valid and your request is correctly formatted.

Common next steps

After successfully making your initial API call to Messari, several common paths can enhance your integration and data utilization:

  • Explore More Endpoints: The Messari API offers a variety of endpoints beyond basic asset listings. Investigate the Messari API documentation for endpoints related to specific asset metrics (e.g., historical data, supply metrics), news, or governance. For instance, you could fetch specific asset metrics for Bitcoin using the /api/v2/assets/{assetKey}/metrics endpoint.
  • Integrate into an Application: Move beyond cURL by integrating API calls into a programming language like Python, JavaScript, or Node.js. Libraries like requests in Python or fetch in JavaScript simplify HTTP requests and JSON parsing. When building applications, consider using environment variables for API keys to maintain security, as recommended by Google developers for API key security.
  • Handle Rate Limits: Messari, like many data providers, implements rate limiting to ensure fair usage and system stability. Review Messari's documentation for specific rate limit policies. Implement error handling for HTTP 429 Too Many Requests responses, often involving exponential backoff strategies.
  • Implement Data Storage and Caching: For applications requiring frequent access to the same data, consider caching responses locally to reduce API calls and improve performance. Implement a strategy to refresh cached data periodically to maintain accuracy.
  • Monitor API Usage: Regularly check your Messari account dashboard to monitor your API usage against your plan's limits. This helps prevent unexpected service interruptions due to exceeding quotas.
  • Explore Webhooks (if available): For real-time data updates, investigate if Messari offers webhook functionality. Webhooks allow Messari to push data to your application when certain events occur, reducing the need for constant polling.

Troubleshooting the first call

Encountering issues during your first API call is common. Here's a guide to troubleshoot typical problems:

  • Invalid API Key (HTTP 401/403):
    • Issue: The most frequent cause for HTTP 401 Unauthorized or HTTP 403 Forbidden errors.
    • Solution: Double-check that you have copied the API key correctly from your Messari dashboard. Ensure no extra spaces or characters are included. Verify that the key is passed in the correct HTTP header (x-messari-api-key) as specified in the Messari API documentation.
  • Incorrect Endpoint or Parameters (HTTP 404/400):
    • Issue: Receiving HTTP 404 Not Found or HTTP 400 Bad Request.
    • Solution: Compare your request URL and parameters precisely with the Messari API documentation. Check for typos in the endpoint path or parameter names (e.g., fields vs. field). Ensure all required parameters are included and correctly formatted.
  • Rate Limit Exceeded (HTTP 429):
    • Issue: An HTTP 429 Too Many Requests error indicates you've sent too many requests within a specific time frame.
    • Solution: Wait for a short period before retrying. For ongoing development, implement exponential backoff in your code, which increases the delay between retries after successive failures. Refer to Messari's specific rate limit policies.
  • Network or Connection Issues:
    • Issue: No response, connection timeouts, or other network-related errors.
    • Solution: Verify your internet connection. If using cURL, try a simple public API call (e.g., curl https://api.ipify.org?format=json) to confirm general connectivity. Check for any firewall or proxy settings that might be blocking outgoing requests.
  • JSON Parsing Errors:
    • Issue: The API returns data, but your application struggles to parse it.
    • Solution: Use a JSON validator to inspect the raw response from the API. This helps identify malformed JSON or unexpected data structures. Ensure your parsing logic correctly handles the nested structure of Messari's API responses, especially when dealing with fields like metrics/market_data/price_usd.
  • Subscription Tier Limitations:
    • Issue: Certain data fields or endpoints return empty or limited data, even with a valid API key.
    • Solution: Check your current Messari subscription plan. Some advanced data points or historical depths are only available on higher tiers (Pro or Enterprise). The free Basic tier has significant data access restrictions.