Retention Metrics

Rest API to fetch the retention metrics of a specified blockchain

Run in Postman

Description

This endpoint retrieves the weekly retention metrics of the specified blockchain for a given date range. It requires an API key for authentication and valid date range inputs.

Request

  • Method: GET

  • Headers:

    • X-API-Key: A valid API key for authentication.

  • Body Parameters:

    • chain: The blockchain to query. This should be one of ETHEREUM, ARBITRUM, BSC, OPTIMISM, BASE or POLYGON

    • start_date: The start date for the query (YYYY-MM-DD format).

    • end_date: The end date for the query (YYYY-MM-DD format).

Response

  • Success: Returns a JSON array of objects with cohort_start_date (in YYYY-MM-DD format) and its retention in terms of user_count

  • Error: Returns an error message with an appropriate status code in case of invalid API key, missing parameters, or server issues.

Sample Request

{
  "chain": "ETHEREUM",
  "start_date": "2023-05-08",
  "end_date": "2023-05-31"
}

Sample Response

{
'data': [
        {
            'cohort_start_date': '2023-05-08',
            'retention': [
                {'user_count': 459145, 'week': '2023-05-08'},
                {'user_count': 73155, 'week': '2023-05-15'},
                {'user_count': 49940, 'week': '2023-05-22'},
                {'user_count': 38329, 'week': '2023-05-29'},
            ],
        },
        {
            'cohort_start_date': '2023-05-15',
            'retention': [
                {'user_count': 493032, 'week': '2023-05-15'},
                {'user_count': 69020, 'week': '2023-05-22'},
                {'user_count': 61726, 'week': '2023-05-29'},
            ],
        }
        ....
    }

Example

POST https://dashboard.withblaze.app/api/business-metrics/retention

Headers

NameTypeDescription

x-api-key*

API-KEY

Your Blaze API Key

Request Body

NameTypeDescription

chain*

Enum

One of the supported chains - ETHEREUM, ARBITRUM, BSC, OPTIMISM, BASE or POLYGON

start_date*

String

Start date for the queried metric

end_date*

String

End date for the queried metric

[
  {"date": "2023-01-01", "active_users": 12000},
  {"date": "2023-01-02", "active_users": 12500},
  ...
]

Last updated