# Community Data API



Default module [#default-module]

Base URLs: [https://api.alkimi.org](https://api.alkimi.org)

Authentication [#authentication]

Public [#public]

<a id="opIdgetData" />

GET Get Data [#get-get-data]

GET /api/v1/public/data

Community Data API Documentation [#community-data-api-documentation]

Overview [#overview]

The Community Data API provides access to aggregated community statistics including transaction counts, impression counts, and revenue data. Access to the API is rate-limited to ensure fair usage for all clients.

Endpoint [#endpoint]

```http
GET /api/v1/public/data
```

Query Parameters [#query-parameters]

| Parameter | Required | Description                        | Format     |
| --------- | -------- | ---------------------------------- | ---------- |
| startDate | Yes      | Start date of the requested period | YYYY-MM-DD |
| endDate   | Yes      | End date of the requested period   | YYYY-MM-DD |

Rate Limiting [#rate-limiting]

To ensure fair usage, the API implements rate limiting. Current limits are tracked via response headers:

* `X-RateLimit-Remaining`: Number of requests remaining in the current time window
* `X-RateLimit-Reset`: Unix timestamp when the rate limit resets
* `X-Daily-Quota-Remaining`: Number of requests remaining for the current day

Constraints [#constraints]

* Maximum date range: 31 days
* End date must not be before start date
* Dates must be in YYYY-MM-DD format

Response Format [#response-format]

Success Response (200 OK) [#success-response-200-ok]

```json
{
  "status": "Success",
  "data": [
    {
      "date": "2024-12-18",
      "txn_count": 1000,
      "impr_count": 5000,
      "alkimi_revenue": 150.75
    }
  ]
}
```

Response Fields [#response-fields]

| Field           | Type   | Description               |
| --------------- | ------ | ------------------------- |
| date            | string | Date in YYYY-MM-DD format |
| txn\_count      | number | Number of transactions    |
| impr\_count     | number | Number of impressions     |
| alkimi\_revenue | number | Revenue amount            |

Error Responses [#error-responses]

Invalid Request (400) [#invalid-request-400]

Returned when the request parameters are invalid.

```json
{
  "code": "ALK1005",
  "message": "Invalid Request Parameter – One or more parameters in the request are invalid."
}
```

Rate Limit Exceeded (429) [#rate-limit-exceeded-429]

Returned when rate limit or daily quota is exceeded.

```json
{
  "code": "ALK1010",
  "message": "Rate Limit Exceeded – Too many requests in a given amount of time."
}
```

Example Requests [#example-requests]

cURL [#curl]

```bash
curl -X GET 'https://api.alkimi.org/api/v1/public/data?startDate=2024-12-01&endDate=2024-12-18'
```

JavaScript [#javascript]

```javascript
const response = await fetch(
  "https://api.alkimi.org/api/v1/public/data?startDate=2024-12-01&endDate=2024-12-18"
)
const data = await response.json()
```

Python [#python]

```python
import requests

response = requests.get(
    'https://api.alkimi.org/api/v1/public/data',
    params={
        'startDate': '2024-12-01',
        'endDate': '2024-12-18'
    }
)
data = response.json()
```

Best Practices [#best-practices]

1. Monitor rate limit headers to avoid hitting limits
2. Implement exponential backoff when rate limits are hit
3. Keep date ranges within the 31-day limit
4. Always use YYYY-MM-DD format for dates
5. Cache responses when appropriate

Support [#support]

For API support or questions, please contact [support](mailto:support@alkimi.org)

Params [#params]

| Name      | Location | Type   | Required | Description                                     |
| --------- | -------- | ------ | -------- | ----------------------------------------------- |
| startDate | query    | string | no       | starting date from which you want to fetch data |
| endDate   | query    | string | no       | ending date upto which you want to fetch data   |

> Response Examples

> 200 Response

```json
{
  "status": "string",
  "data": [
    {
      "date": "string",
      "txn_count": 0,
      "impr_count": 0,
      "alkimi_revenue": 0
    }
  ]
}
```

Responses [#responses]

| HTTP Status Code | Meaning                                                 | Description | Data schema |
| ---------------- | ------------------------------------------------------- | ----------- | ----------- |
| 200              | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | none        | Inline      |

Responses Data Schema [#responses-data-schema]

HTTP Status Code **200**

*Resposne*

| Name               | Type      | Required | Restrictions | Title | description                                                      |
| ------------------ | --------- | -------- | ------------ | ----- | ---------------------------------------------------------------- |
| » status           | string    | true     | none         |       | sucess status                                                    |
| » data             | \[object] | true     | none         |       | array of transaction count , impression count and alkimi revenue |
| »» date            | string    | false    | none         |       | date for which data is shown                                     |
| »» txn\_count      | integer   | false    | none         |       | transaction count for same day                                   |
| »» impr\_count     | integer   | false    | none         |       | impression count for day                                         |
| »» alkimi\_revenue | number    | false    | none         |       | alkmi revenue for date                                           |

Read-only API Keys for CEX Buyback Verification [#read-only-api-keys-for-cex-buyback-verification]

Read-only API keys that allows the ALKIMI community to independently verify buyback transactions on each CEX.

KuCoin [#kucoin]

| Field      | Value                                  |
| ---------- | -------------------------------------- |
| Passphrase | `AlexTheAlkimist!`                     |
| API Key    | `69cc0463fafd9100015a35c8`             |
| API Secret | `3dc1d0d2-7d0d-4158-b685-15490a94a013` |

Gate.io [#gateio]

| Field      | Value                                                              |
| ---------- | ------------------------------------------------------------------ |
| API Key    | `0f785638a8d058d666e11979b9f52409`                                 |
| API Secret | `36242438668099d39fc33e19b67eca2a174f782cd1b3ef59a831ffb28cc21809` |

MEXC [#mexc]

| Field      | Value                              |
| ---------- | ---------------------------------- |
| API Key    | `mx0vglD4PA4EcLH2fZ`               |
| API Secret | `20e484a56ddd427a9b7a07f608a379cc` |
