mirror of
https://github.com/Redume/Kekkai.git
synced 2025-02-23 04:33:11 +03:00
chore(docs): Added documentation about the metadata router
This commit is contained in:
parent
87d19540f8
commit
c944e552ec
3 changed files with 67 additions and 5 deletions
|
@ -7,10 +7,11 @@ https://kekkai-api.redume.su/api/
|
||||||
|
|
||||||
|
|
||||||
## API Endpoints
|
## 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.
|
Below you will find a list of parameters that each endpoint requires and a description of what the API does.
|
||||||
|
|
||||||
| Service | API Endpoint | Description |
|
| Service | API Endpoint | Description |
|
||||||
|--------------|--------------------------------------------------------|--------------------------------------------------------------------|
|
|--------------|----------------------------------------------|---------------------------------------------------------------------------------------------|
|
||||||
| Get Rate | `https://kekkai-api.redume.su/api/getRate/` | Get currency exchange rate for a specific day or period |
|
| 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 |
|
| 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 |
|
60
docs/endpoints/metadata.md
Normal file
60
docs/endpoints/metadata.md
Normal file
|
@ -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"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
|
@ -18,6 +18,7 @@ nav:
|
||||||
- Endpoints list: endpoints/list-endpoints.md
|
- Endpoints list: endpoints/list-endpoints.md
|
||||||
- Get currency rate - /api/getRate: endpoints/get-rate.md
|
- Get currency rate - /api/getRate: endpoints/get-rate.md
|
||||||
- Create Charts - /api/getChart: endpoints/create-chart.md
|
- Create Charts - /api/getChart: endpoints/create-chart.md
|
||||||
|
- Get Metadata - /api/metadata: endpoints/metadata.md
|
||||||
- Config:
|
- Config:
|
||||||
- Configure config.yaml: config/config-yaml.md
|
- Configure config.yaml: config/config-yaml.md
|
||||||
- Configure .env: config/config-env.md
|
- Configure .env: config/config-env.md
|
||||||
|
|
Loading…
Add table
Reference in a new issue