ForeignAffairs API endpoint
Returns public article metadata and ordered body paragraphs from a canonical Foreign Affairs article URL. Incomplete, truncated, challenge, or contaminated upstream HTML is rejected as an upstream error.
/foreignaffairs/articleQuery parameters:
url (required): canonical https://www.foreignaffairs.com/<section>/<slug> article URL.The response contains the canonical URL, title, description, publication and optional update timestamps, author and category arrays, lead image, is_gated, and ordered body paragraphs. The service only succeeds when the upstream page supplies complete article metadata and one unique body container; truncated reads, challenge pages, and subscription UI mixed into the body are returned as upstream errors.
A missing upstream article returns 404; invalid URL input returns 400.
| Field | In the sample | Value in the sample |
|---|---|---|
| url | Has a value | foreignaffairs.com |
| title | Has a value | 24 characters |
| description | Has a value | 50 characters |
| published_at | Has a value | 2026-09-18 |
| updated_at | Has a value | 2026-09-25 |
| authors | Has a value | 1 entry |
| categories | Has a value | 12 entries |
| image_url | Has a value | cdn-live.foreignaffairs.com |
| is_gated | Has a value | true |
| paragraphs | Has a value | 23 entries |
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
| url | string | Yes | Canonical Foreign Affairs article URL | https://www.foreignaffairs.com/united-states/americas-attrition-trap | |
| x-api-key (header) | string | Yes | API key required |
curl -X GET "https://api.crawlora.net/api/v1/foreignaffairs/article?url=https%3A%2F%2Fwww.foreignaffairs.com%2Funited-states%2Famericas-attrition-trap" \ -H "x-api-key: $CRAWLORA_API_KEY"
{
"code": 200,
"msg": "OK",
"data": {
"url": "https://www.foreignaffairs.com/united-states/americas-attrition-trap",
"title": "America's Attrition Trap",
"description": "A representative article description.",
"published_at": "2026-09-18T10:00:00Z",
"updated_at": "2026-09-18T12:00:00Z",
"authors": [
"Example Author"
],
"categories": [
"United States"
],
"image_url": "https://cdn.example.com/article.jpg",
"is_gated": true,
"paragraphs": [
"The opening paragraph.",
"The next paragraph."
]
}
}Request schema
No body schema
Response schema
#/definitions/foreignaffairs.articleResponseDoc
| Field | Type | Required | Enum | Bounds | Example | Description |
|---|---|---|---|---|---|---|
| code | integer | No | 200 | |||
| data | foreignaffairs.ArticleResponse | No | ||||
| data.authors | array | No | ||||
| data.categories | array | No | ||||
| data.description | string | No | ||||
| data.image_url | string | No | ||||
| data.is_gated | boolean | No | ||||
| data.paragraphs | array | No | ||||
| data.published_at | string | No | ||||
| data.title | string | No | ||||
| data.updated_at | string | No | ||||
| data.url | string | No | ||||
| msg | string | No | OK |
| Status | Description | Schema |
|---|---|---|
| 400 | Bad Request | #/definitions/app.Response |
| 404 | Not Found | #/definitions/app.Response |
| 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/foreignaffairs/article?url=https%3A%2F%2Fwww.foreignaffairs.com%2Funited-states%2Famericas-attrition-trap" \
-H "x-api-key: $CRAWLORA_API_KEY"