A simple API to serve discord.js docs using discord.js-docs.
V1
Returns the entire formatted documentation for the given project and branch.
Project can be one of: main
, commando
, rpc
.
Set the
raw
queryparam totrue
to receive the original fetched JSON without any formatting.
Doesn't work for the/search
and/embed
endpoints.
Example:/v1/main/master?raw=true
,/v1/main/stable/message/content?raw=true
Set the
force
queryparam totrue
to force fetch the docs instead of reading from cache.
Works for all endpoints.
Example:/v1/main/master?force=true
Returns the documentation for a single element.
:parent
and :child
have to be element names. Case does not matter.
:child
can be omitted.
Searches the documentation using fuzzy search and returns top 10 hits.
The query must be specified under the q
queryparam.
Will return 400 if no query specified.
Example:
/v1/main/master/search?q=reaction%20collector
Tries to resolve the query into a single element.
The query must be specified under the q
queryparam.
If that fails, falls back to the behaviour of the .../search
route.
Query is expected to be separated with #
(%23 when uri encoded) or .
for exact searches.
The result is formatted into a Discord embed object.
Will return 400 if no query specified.
Examples:
/v1/main/stable/embed?q=message%23pin
/v1/main/master/embed?q=reaction%20collector
V2
The version 2 of the API relies more on query parameters. The query parameters you should know about for all endpoints are the following:
-
src
- Source. Indicates the what documentation data should be pulled from. This parameter can be an URL to a valid JSON file containing the docs or one of the predefined keywords:stable
,master
,commando
,rpc
,akairo
,akairo-master
andcollection
-
force
-true
orfalse
. Indicates whether local cache should be ignored. In case it is set totrue
, the documentation will be pulled anew from the source and cached, overwriting the old one. Defaults tofalse
. -
q
- Query. Meaning depends on endpoint, see more detailed description below.
Query Parameter | Description | Examples |
---|---|---|
src |
Source documentation | master |
force |
Ignore cache | true , false |
q |
Query | Client , Message#author , Message.author.username |
Returns the documentation for a single element. Query should be well formed as shown in the example.
Use #
(%23
when URI encoded) or .
as separators.
Examples:
/v2?src=master&q=Client
/v2?src=stable&force=true&q=Message%23author
Query Parameter | Description | Examples |
---|---|---|
src |
Source documentation | master |
force |
Ignore cache | true , false |
q |
Query | permissions , ban member |
Searches the documentation for the given query and returns top 10 hits. Query can be whatever.
Examples:
/v2/search?src=master&q=permissions
/v2/search?src=stable&force=true&q=ban%20member
Query Parameter | Description | Examples |
---|---|---|
src |
Source documentation | master |
force |
Ignore cache | true , false |
q |
Query | permissions , ban member |
Tries to resolve the query into a single element.
If that fails, falls back to the behaviour of the /v2/search
endpoint.
The result is formatted into a Discord embed object.
Examples:
/v2/embed?src=master&q=permissions
/v2/embed?src=stable&force=true&q=ban%20member