mirror of
https://github.com/xHyroM/website.git
synced 2024-11-21 14:41:04 +01:00
feat(docs/discord-experiments-api): add stats docs
This commit is contained in:
parent
9f72e2e1ec
commit
140f5d7cc2
3 changed files with 49 additions and 1 deletions
|
@ -23,5 +23,9 @@ export const docs: Docs = {
|
|||
text: "Eligible",
|
||||
link: "/docs/discord-experiments-api/eligible",
|
||||
},
|
||||
{
|
||||
text: "Stats",
|
||||
link: "/docs/discord-experiments-api/stats",
|
||||
}
|
||||
],
|
||||
};
|
44
docs/discord-experiments-api/stats.md
Normal file
44
docs/discord-experiments-api/stats.md
Normal file
|
@ -0,0 +1,44 @@
|
|||
---
|
||||
title: Stats
|
||||
description: Get stats from the API
|
||||
---
|
||||
|
||||
# Stats
|
||||
|
||||
This section of the documentation will cover how to get stats from the API.
|
||||
|
||||
Accessible on [https://api.discord-experiments.xhyrom.dev/v2/stats](https://api.discord-experiments.xhyrom.dev/v2/stats)
|
||||
|
||||
## Stats Object
|
||||
|
||||
Represents stats of the API
|
||||
|
||||
**Stats Structure:**
|
||||
| field | type | description |
|
||||
| ----- | --------------------------- | -------------------------- |
|
||||
| total | integer | Total sum of experiments |
|
||||
| kind | [kind object](#kind-object) | Sum of experiments by kind |
|
||||
|
||||
## Kind Object
|
||||
|
||||
Represents number of experiments by kind
|
||||
|
||||
**Kind Structure:**
|
||||
|
||||
| field | type | description |
|
||||
| ------- | ------- | ------------------------ |
|
||||
| guild | integer | Sum of guild experiments |
|
||||
| user | integer | Sum of user experiments |
|
||||
| other * | integer | Sum of other experiments |
|
||||
|
||||
* Other experiments are experiments that are not guild or user specific. This will be always 0, because there are no other experiments.
|
||||
|
||||
## Fetching stats
|
||||
|
||||
You can fetch stats from the API by sending a GET request to [https://api.discord-experiments.xhyrom.dev/v2/stats](https://api.discord-experiments.xhyrom.dev/v2/stats)
|
||||
|
||||
```
|
||||
GET https://api.discord-experiments.xhyrom.dev/v2/stats
|
||||
```
|
||||
|
||||
Returns a [stats object](#stats-object)
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
import { docs, type Sidebar } from "@pages/docs/config";
|
||||
import { docs, type Sidebar } from "@docs/config";
|
||||
const { currentPage } = Astro.props;
|
||||
const currentPageMatch = currentPage.slice(1);
|
||||
|
||||
|
|
Loading…
Reference in a new issue