Files

46 lines
1.1 KiB
Markdown
Raw Permalink Normal View History

2022-04-04 20:26:46 +08:00
# API
2019-03-24 23:44:16 +08:00
:::warning
2023-08-21 22:08:41 +08:00
The API is under active development and is subject to change. All suggestions are welcome!
2023-08-21 22:08:41 +08:00
2019-03-24 23:44:16 +08:00
:::
RSSHub provides the following APIs:
2019-03-24 23:44:16 +08:00
## List of Public Routes
2019-03-24 23:44:16 +08:00
2023-08-21 22:08:41 +08:00
:::tip
This API **will not** return any routes under `lib/protected_router.js`.
2023-08-21 22:08:41 +08:00
2019-03-24 23:44:16 +08:00
:::
2023-10-24 16:33:51 +00:00
Eg: [https://rsshub.app/api/routes/github](https://rsshub.app/api/routes/github)
2019-03-24 23:44:16 +08:00
Route: `/api/routes/:name?`
2019-03-24 23:44:16 +08:00
Parameters:
2019-03-24 23:44:16 +08:00
- `name`, route's top level name as in [https://github.com/DIYgod/RSSHub/tree/master/lib/routes](https://github.com/DIYgod/RSSHub/tree/master/lib/routes). Optional, **returns all public routes if not specified**.
2019-03-24 23:44:16 +08:00
A successful request returns an HTTP status code `200 OK` with the result in JSON:
2019-03-24 23:44:16 +08:00
```js
{
"status": "success",
"data": {
"github": {
2019-03-24 23:44:16 +08:00
"routes": [
"/github/trending/:since/:language?",
"/github/issue/:user/:repo",
"/github/user/followers/:user",
"/github/stars/:user/:repo"
2019-03-24 23:44:16 +08:00
]
}
},
"message": "request returned 4 routes"
2019-03-24 23:44:16 +08:00
}
```
If no matching results were found, the server returns only an HTTP status code `204 No Content`.