Skip to content

Get articles by category with /v1/news/category/{taxonomy}/{category_id} ​

Get articles in a specific category with /v1/news/category/{taxonomy}/{category_id}. Add shared filters to narrow the results.

Each request costs 1 point. Using the prompt parameter adds 2 points; prompt requires Basic or above.

Endpoint ​

GET  /v1/news/category/{taxonomy}/{category_id}
POST /v1/news/category/{taxonomy}/{category_id}

Base URL: https://api.apitube.io. Example: /v1/news/category/iptc_mediatopics/medtop:04000000.

The directory supports four category systems: iptc_mediatopics, apitube, iab-qag and iptc-subjectcode. Category autocomplete searches all four. Only two currently return articles:

TaxonomyCategoriesArticles
iptc_mediatopics1085the classified archive
apitubeuncategorized only~9.7M unclassified articles
iab-qagIAB QAG codes (IAB12, IAB24, …)none
iptc-subjectcodelegacy numeric subject codesnone

Categories from the two empty systems return no results. Check a category with /v1/news/count before using it in a feed. An unknown taxonomy name in the path returns 404 ER0242.

Path vs. the category.id filter ​

You can select a category in the URL path or with a filter:

Path formFilter form
Request/v1/news/category/iptc_mediatopics/medtop:04000000/v1/news/everything?category.id=medtop:04000000
Categories per requestOneSeveral, comma-separated
ExclusionNot availableignore.category.id
Unknown ID404 ER0241400 ER0206

Use the path for a single-category feed or page. Use category.id to combine categories or exclude them.

Where category IDs come from ​

  • List of Categories — the full IPTC Media Topics tree.
  • /v1/suggest/categories to suggest categories as a user types.
  • The categories array of any article in a response; links.self there already contains a ready-made category URL.

Parameters ​

Path parameters ​

ParameterTypeRequiredDescription
taxonomystringYesCategory system, for example iptc_mediatopics.
category_idstringYesCategory ID.

See Filters for all shared search filters, sorting, pagination, field selection and other request options.

Response format ​

The response uses the shared Response format. See API Response Structure for all article fields.

Request examples ​

bash
curl "https://api.apitube.io/v1/news/category/iptc_mediatopics/medtop:04000000?language.code=en&per_page=10&api_key=YOUR_API_KEY"
python
import requests

response = requests.get(
    "https://api.apitube.io/v1/news/category/iptc_mediatopics/medtop:04000000",
    params={"language.code": "en", "per_page": 10},
    headers={"X-API-Key": "YOUR_API_KEY"},
)

for article in response.json()["results"]:
    print(article["published_at"], article["title"])
javascript
const taxonomy = 'iptc_mediatopics';
const categoryId = 'medtop:04000000';

const response = await fetch(
  `https://api.apitube.io/v1/news/category/${taxonomy}/${encodeURIComponent(categoryId)}?language.code=en`,
  { headers: { 'X-API-Key': 'YOUR_API_KEY' } }
);

console.log((await response.json()).results.length);

Last 24 hours in a category, most engaging first ​

bash
curl "https://api.apitube.io/v1/news/category/iptc_mediatopics/medtop:04000000?published_at.start=NOW-1DAY&sort.by=engagement&api_key=YOUR_API_KEY"

Errors ​

CodeStatusMeaning
ER0241404No category with that ID
ER0242404The category exists but not in the taxonomy given in the path
ER0175401API key is missing or invalid
ER0176402No points left on the account
ER0203429Rate limit exceeded

See HTTP response codes for the full error list.