docs: distools-api -> dux

This commit is contained in:
Jozef Steinhübl 2024-03-12 22:36:09 +01:00
parent cadf87572f
commit 6a9abf072d
No known key found for this signature in database
GPG key ID: E944BC293F5FF7E7
9 changed files with 125 additions and 104 deletions

View file

@ -15,23 +15,27 @@ export interface Sidebar {
export const docs: Docs = {
sidebar: [
{
text: "Discord Tools API",
text: "DUX API",
items: [
{
text: "Introduction",
link: "/docs/distools-api/introduction",
link: "/docs/dux/introduction",
},
{
text: "Experiments",
link: "/docs/distools-api/experiments",
link: "/docs/dux/experiments",
},
{
text: "Eligible",
link: "/docs/distools-api/eligible",
link: "/docs/dux/eligible",
},
{
text: "Endpoints",
link: "/docs/dux/endpoints",
},
{
text: "Stats",
link: "/docs/distools-api/stats",
link: "/docs/dux/stats",
},
],
},

View file

@ -1,25 +0,0 @@
---
title: Introduction
description: Introduction to the Distools API
---
# Introduction
This section of the documentation will cover the basics of the Distools API, and how to use it.
Accessible on [https://api.distools.xhyrom.dev/v2](https://api.distools.xhyrom.dev/v2)
## What is the Distools API?
It's about the Distools API, which allows you to get information about Discord's experiments. It's a public API, so you don't need any token to use it.
## How it works?
It scrapes everything from client, and also from [https://discord.com/api/v10/experiments?with_guild_experiments=true](https://discord.com/api/v10/experiments?with_guild_experiments=true) for **some** guild rollouts.
This api **contains** all known experiments and their rollouts (if available).
## Source code
This api is currently closed source, but we will do our best to make it open source in the future.
If you don't trust us, you can scrape everything from our [Discord-Datamining](https://github.com/xHyroM/discord-datamining) repository, which is open source. There's file inside [data/experiments.json](https://github.com/xHyroM/discord-datamining/blob/master/data/experiments.json) which contains all experiments and their rollouts from our API (updates every 5 minutes).

View file

@ -1,44 +0,0 @@
---
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.distools.xhyrom.dev/v2/stats](https://api.distools.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.distools.xhyrom.dev/v2/stats](https://api.distools.xhyrom.dev/v2/stats)
```
GET https://api.distools.xhyrom.dev/v2/stats
```
Returns a [stats object](#stats-object)

View file

@ -5,14 +5,9 @@ description: How to check if a guild is eligible for an experiment
# Eligible
<div style="background-color: #e8c192; border-color: #fc8c03; color: #9c611a; padding-top: 0.7rem; padding-bottom: 0.7rem; padding-left: 0.7rem; padding-right: 0.8rem; border-left-width: 4px" role="alert">
<span style="font-weight: 700;">Be Warned</span><br />
<span>Unfortunately, this endpoint is not currently available due to capacity issues.</span>
</div>
This section of the documentation will cover how to check if a guild is eligible for an experiment.
Accessible on [https://api.distools.xhyrom.dev/v2/eligible](https://api.distools.xhyrom.dev/v2/eligible)
Accessible on [https://dux.xhyrom.dev/v2/eligible](https://dux.xhyrom.dev/v2/eligible)
## Eligible Object
@ -31,7 +26,7 @@ Represents the eligibility of a guild for an experiment
## Checking eligibility
You can check if a guild is eligible for an experiment by sending a POST request to [https://api.distools.xhyrom.dev/v2/eligible](https://api.distools.xhyrom.dev/v2/eligible)
You can check if a guild is eligible for an experiment by sending a POST request to [https://dux.xhyrom.dev/v2/eligible](https://dux.xhyrom.dev/v2/eligible)
**Body:**
@ -43,7 +38,7 @@ You can check if a guild is eligible for an experiment by sending a POST request
\* Only `id`, `features` and `member_count` fields are checked and `id` is required
```
POST https://api.distools.xhyrom.dev/v2/eligible
POST https://dux.xhyrom.dev/v2/eligible
{
"experiment_id": "2023-03_clyde_ai",

21
docs/dux/endpoints.md Normal file
View file

@ -0,0 +1,21 @@
---
title: Endpoints
description: Get list of all endpoints
---
# Endpoints
This section of the documentation will cover how to get list of all endpoints.
It's possible that not all endpoints are scraped, as it's scraped from the canary client.
Accessible on [https://dux.xhyrom.dev/v2/endpoints](https://dux.xhyrom.dev/v2/endpoints)
## Fetching endpoints
You can fetch list of all endpoints by sending a GET request to [https://dux.xhyrom.dev/v2/endpoints](https://dux.xhyrom.dev/v2/endpoints)
```
GET https://dux.xhyrom.dev/v2/endpoints
```
Returns a `dictionary` of endpoints, where key is the endpoint name and value is the endpoint url.

View file

@ -1,13 +1,13 @@
---
title: Experiments
description: How to fetch experiments from the API
description: How to fetch experiments
---
# Experiments
This section of the documentation will cover how to fetch experiments from the API.
This section of the documentation will cover how to fetch experiments.
Accessible on [https://api.distools.xhyrom.dev/v2/experiments](https://api.distools.xhyrom.dev/v2/experiments)
Accessible on [https://dux.xhyrom.dev/v2/experiments](https://dux.xhyrom.dev/v2/experiments)
## Experiment Object
@ -153,7 +153,7 @@ If the guild experiment hash (murmurhash v3 unsigned of `experiment_name:guild_i
## Fetching all experiments
You can fetch experiments from the API by sending a GET request to [https://api.distools.xhyrom.dev/v2/experiments](https://api.distools.xhyrom.dev/v2/experiments).
You can fetch experiments from the API by sending a GET request to [https://dux.xhyrom.dev/v2/experiments](https://dux.xhyrom.dev/v2/experiments).
<div style="background-color: #e8c192; border-color: #fc8c03; color: #9c611a; padding-top: 0.7rem; padding-bottom: 0.7rem; padding-left: 0.7rem; padding-right: 0.8rem; border-left-width: 4px" role="alert">
<span style="font-weight: 700;">Be Warned</span><br />
@ -171,24 +171,19 @@ You can fetch experiments from the API by sending a GET request to [https://api.
\* If you want multiple kinds, you can separate them with a comma (,)
```
GET https://api.distools.xhyrom.dev/v2/experiments
GET https://dux.xhyrom.dev/v2/experiments
```
Returns array of [Experiment Object](#experiment-object)
## Fetching experiment
<div style="background-color: #e8c192; border-color: #fc8c03; color: #9c611a; padding-top: 0.7rem; padding-bottom: 0.7rem; padding-left: 0.7rem; padding-right: 0.8rem; border-left-width: 4px" role="alert">
<span style="font-weight: 700;">Be Warned</span><br />
<span>Unfortunately, this endpoint is not currently available due to capacity issues. As workaround, you can fetch all the experiments and filter yourself.</span>
</div>
You can fetch a specific experiment from the API by sending a GET request to [https://api.distools.xhyrom.dev/v2/experiments/:experimentId](https://api.distools.xhyrom.dev/v2/experiments/:experimentId).
You can fetch a specific experiment from the API by sending a GET request to [https://dux.xhyrom.dev/v2/experiments/:experimentId](https://dux.xhyrom.dev/v2/experiments/:experimentId).
You can use same query parameters as in [Fetching all experiments](#fetching-all-experiments)
```
GET https://api.distools.xhyrom.dev/v2/experiments/:experimentId
GET https://dux.xhyrom.dev/v2/experiments/:experimentId
```
Returns [Experiment Object](#experiment-object)

26
docs/dux/introduction.md Normal file
View file

@ -0,0 +1,26 @@
---
title: Introduction
description: Introduction to the dux api
---
# Introduction
This section of the documentation will cover the basics of the DUX API, and how to use it.
Accessible on [https://dux.xhyrom.dev/v2](https://dux.xhyrom.dev/v2)
## What is the DUX?
It's about the DUX, which allows you to get information about Discord's experiments and endpoints. It's a public API, so you don't need any token to use it.
## How it works?
It scrapes everything from client, and also from [https://discord.com/api/v10/experiments?with_guild_experiments=true](https://discord.com/api/v10/experiments?with_guild_experiments=true) for **some** guild rollouts.
This api **contains** all known experiments and their rollouts (if available).
## Source code
This api is currently closed source, but we will do our best to make it open source in the future.
If you don't trust us, you can scrape everything from our [Discord-Datamining](https://github.com/xHyroM/discord-datamining) repository, which is open source. There's file inside [experiments.json](https://github.com/xHyroM/discord-datamining/blob/master/data/client/experiments/experiments.json) which contains all experiments and their rollouts from our API (updates every 5 minutes).
File [routes.json](https://github.com/xHyroM/discord-datamining/blob/master/data/client/routes.json) contains all scraped endpoints from canary client.

53
docs/dux/stats.md Normal file
View file

@ -0,0 +1,53 @@
---
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://dux.xhyrom.dev/v2/stats](https://dux.xhyrom.dev/v2/stats)
## Stats object
Represents number of experiments and endpoints
**Stats Structure:**
| field | type | description |
| ----------- | --------------------------------------------------- | ---------------------- |
| experiments | [experiment stats object](#experiment-stats-object) | Experiment stats |
| endpoints | integer | Total sum of endpoints |
## Experiment Stats Object
Represents number of experiments
**Stats Structure:**
| field | type | description |
| ----- | ------------------------------------------------- | -------------------------- |
| total | integer | Total sum of experiments |
| kind | [experiment kind object](#experiment-kind-object) | Sum of experiments by kind |
## Experiment 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 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://dux.xhyrom.dev/v2/stats](https://dux.xhyrom.dev/v2/stats)
```
GET https://dux.xhyrom.dev/v2/stats
```
Returns a [stats object](#stats-object)

View file

@ -13,27 +13,23 @@
"redirects": [
{
"source": "/docs",
"destination": "/docs/distools-api/introduction"
"destination": "/docs/dux/introduction"
},
{
"source": "/docs/",
"destination": "/docs/distools-api/introduction"
},
{
"source": "/docs/distools-api",
"destination": "/docs/distools-api/introduction"
"destination": "/docs/dux/introduction"
},
{
"source": "/docs/peddlerspocket",
"destination": "/docs/peddlerspocket/introduction"
},
{
"source": "/docs/discord-experiments-api",
"destination": "/docs/distools-api/introduction"
"source": "/docs/distools-api",
"destination": "/docs/dux/introduction"
},
{
"source": "/docs/discord-experiments-api/:name",
"destination": "/docs/distools-api/:name"
"source": "/docs/distools-api/:name",
"destination": "/docs/dux/:name"
},
{
"source": "/blog/:name",