Nation Africa API endpoint
Returns the current story teasers of one public Nation Africa section page. Subscriber-only stories carry type "premium". Teasers show only a relative age, so published_at is omitted.
/nationafrica/headlinesQuery parameter: section is required and must be one of news, politics, world, gender, education, business, companies, enterprise, finance-and-markets, seeds-of-gold, sports, football, athletics, rugby, motorsports, other-sports, talkup, counties, coast, lake-region, mountain, nairobi-metro, northern, rift-valley, blogs-opinion, opinion, editorials, letters, blogs, cutting-edge, life-and-style, wellness, travel, relationships, motoring, family, culture, art-books, health, healthy-nation, elections, elections-news, presidential, governor-race, constituencies, explainers, fact-checks. Any other value returns an invalid-params error.
Returns the current story teasers of that section page: up to about 60 stories with title, canonical URL, standfirst summary when shown, and a lead image_url. Stories the publisher labels PREMIUM carry type: "premium". Publication time and byline are not reported, because the page only shows relative times such as "12 hours ago". Video, photo, audio and cartoon items are left out. Section pages can repeat a story that also leads a related section (for example Elections and Blogs & Opinion).
| Field | Filled in, of 26 checked | Values in the sample |
|---|---|---|
| title | 26 | median 58 characters |
| url | 26 | nation.africa |
| summary | 5 | median 85 characters |
| image_url | 17 | nation.africa and 1 other host |
| type | 24 | premium in all 24 |
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
| section | string | Yes | Nation Africa section slug Allowed values: news, politics, world, gender, education, business, companies, enterprise, finance-and-markets, seeds-of-gold, sports, football, athletics, rugby, motorsports, other-sports, talkup, counties, coast, lake-region, mountain, nairobi-metro, northern, rift-valley, blogs-opinion, opinion, editorials, letters, blogs, cutting-edge, life-and-style, wellness, travel, relationships, motoring, family, culture, art-books, health, healthy-nation, elections, elections-news, presidential, governor-race, constituencies, explainers, fact-checks. | news | |
| x-api-key (header) | string | Yes | API key required |
curl -X GET "https://api.crawlora.net/api/v1/nationafrica/headlines?section=news" \ -H "x-api-key: $CRAWLORA_API_KEY"
{
"code": 200,
"data": {
"section": "football",
"items": [
{
"title": "My work permit is the biggest issue, McCarthy reveals",
"url": "https://nation.africa/kenya/sports/football/my-work-permit-is-the-biggest-issue-mccarthy-reveals-amid-questions-about-his-future-5606786",
"type": "premium",
"summary": "McCarthy criticised FKF for failing to secure him a work permit for over one and a half years.",
"image_url": "https://nation.africa/resource/image/5303738/landscape_ratio3x2/120/80/cc81e9b7a74636f336d754f9339bba04/nn/benni-mccarthy-1-.jpg"
}
]
}
}Request schema
No body schema
Response schema
#/definitions/publicnews.headlinesResponseDoc
| Field | Type | Required | Enum | Bounds | Example | Description |
|---|---|---|---|---|---|---|
| data | newsplatform.HeadlinesResponse | No | ||||
| data.items | array | No | HeadlineItem record, 7 fields: author, image_url, published_at, summary, title, type, url. Described under Nation Africa top stories API. | |||
| data.section | string | No |
| Status | Description | Schema |
|---|---|---|
| 400 | Bad Request | #/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/nationafrica/headlines?section=news" \
-H "x-api-key: $CRAWLORA_API_KEY"