NPR API endpoint
Lists the sections in NPR's current navigation, each with its name, slug and URL. Pass a returned `slug` as the `topic` parameter of `npr-topic`. The list is not a fixed set, so it follows whatever sections NPR currently shows.
/npr/categoriesReturns NPR's current public section navigation. Use a returned slug as the topic parameter for npr-topic; the value space is discovered from NPR's own homepage rather than hardcoded.
| Field | Filled in, of 20 checked | Values in the sample |
|---|---|---|
| slug | 20 | |
| name | 20 | “News” and 19 other values |
| url | 20 | npr.org |
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
| x-api-key (header) | string | Yes | API key required |
curl -X GET "https://api.crawlora.net/api/v1/npr/categories" \ -H "x-api-key: $CRAWLORA_API_KEY"
{
"code": 200,
"data": {
"categories": [
{
"slug": "politics",
"name": "Politics",
"url": "https://www.npr.org/sections/politics/"
}
]
},
"msg": "OK"
}Request schema
No body schema
Response schema
#/definitions/npr.categoriesResponseDoc
| Field | Type | Required | Enum | Bounds | Example | Description |
|---|---|---|---|---|---|---|
| code | integer | No | 200 | |||
| data | npr.CategoriesResponse | No | ||||
| data.categories | array | No | ||||
| data.categories[].name | string | No | ||||
| data.categories[].slug | string | No | ||||
| data.categories[].url | string | No | ||||
| msg | string | No | OK |
| Status | Description | Schema |
|---|---|---|
| 429 | Too Many Requests | #/definitions/app.Response |
| 503 | Service Unavailable | #/definitions/app.Response |
Use environment variables for secrets and keep Crawlora API keys server-side.
curl -X GET "https://api.crawlora.net/api/v1/npr/categories" \
-H "x-api-key: $CRAWLORA_API_KEY"