diff --git a/docs/endpoints/list-endpoints.md b/docs/endpoints/list-endpoints.md index f8b61b3..d1878a6 100644 --- a/docs/endpoints/list-endpoints.md +++ b/docs/endpoints/list-endpoints.md @@ -7,10 +7,11 @@ https://kekkai-api.redume.su/api/ ## API Endpoints -Kekkai has 3 API endpoints: `getRate`, `getChart` and `configurations`. +Kekkai has 3 API endpoints: `getRate`, `getChart` and `metadata`. Below you will find a list of parameters that each endpoint requires and a description of what the API does. -| Service | API Endpoint | Description | -|--------------|--------------------------------------------------------|--------------------------------------------------------------------| -| Get Rate | `https://kekkai-api.redume.su/api/getRate/` | Get currency exchange rate for a specific day or period | -| Create Chart | `https://kekkai-api.redume.su/api/getChart` | Creating a chart with exchange rate | \ No newline at end of file +| Service | API Endpoint | Description | +|--------------|----------------------------------------------|---------------------------------------------------------------------------------------------| +| Get Rate | `https://kekkai-api.redume.su/api/getRate/` | Get currency exchange rate for a specific day or period | +| Create Chart | `https://kekkai-api.redume.su/api/getChart/` | Creating a chart with exchange rate | +| Metadata | `https://kekkai-api.redume.su/api/metadata/` | Shows the last and first dates of currency rate collection, as well as available currencies | \ No newline at end of file diff --git a/docs/endpoints/metadata.md b/docs/endpoints/metadata.md new file mode 100644 index 0000000..de7d990 --- /dev/null +++ b/docs/endpoints/metadata.md @@ -0,0 +1,60 @@ +Currencies are identified by standard three-letter `ISO 4217` currency codes. + +## Get data on available dates and currencies. + +### Request +=== "Shell" +=== "Curl" +```bash +curl --request GET \ +--url https://kekkai-api.redume.su/api/metadata/ +``` + +=== "Python" + === "Requests" + ```py + import requests + + res = requests.get('https://kekkai-api.redume.su/api/metadata/', timeout=3) + + print(res.json()) + ``` + +=== "Node.JS" + === "Axios" + ```js + const axios = require('axios'); + + axios.get('https://kekkai-api.redume.su/api/metadata/') + .then((res) => { + console.log(JSON.stringify(res.json())); + }) + .catch((err) => { + console.error(err); + }); + ``` + +### Response +!!! info "Output" + ```json + { + "first_date": "2024-11-26T21:00:00.000Z", + "last_date": "2025-01-01T21:00:00.000Z", + "currencies": { + "crypto": [ + "USDT", + "TON", + "BTC", + "ETH" + ], + "fiat": [ + "USD", + "RUB", + "EUR", + "UAH", + "TRY", + "KZT" + ] + } + } + ``` diff --git a/mkdocs.yml b/mkdocs.yml index ef112fd..f8a6146 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -18,6 +18,7 @@ nav: - Endpoints list: endpoints/list-endpoints.md - Get currency rate - /api/getRate: endpoints/get-rate.md - Create Charts - /api/getChart: endpoints/create-chart.md + - Get Metadata - /api/metadata: endpoints/metadata.md - Config: - Configure config.yaml: config/config-yaml.md - Configure .env: config/config-env.md