Count Articles
The /v1/news/count endpoint returns only the number of articles matching your filters, without loading any article content. It accepts the same filters as /v1/news/everything, but runs a single count(*) query — much cheaper and faster when all you need is the total. It is useful for dashboards, sample-size estimation, and progress bars.
To use the API, you'll require an API key. You can obtain an API key by signing up for an account on the APITube website.
Endpoint
GET /v1/news/count
POST /v1/news/countBoth methods are equivalent: filters can be passed as query parameters (GET) or as a JSON body (POST). The endpoint accepts the same filters as /v1/news/everything — see the Parameters reference and the Interactive Query Builder for the full list.
Query Parameters
The endpoint supports every filter available on /v1/news/everything. Some commonly used ones:
| Parameter | Type | Required | Description |
|---|---|---|---|
title | string | No | Full-text search in article titles. Supports phrase search with proximity. |
language.code | string | No | Filter by language (ISO 639-1), e.g. en. |
category.id | string | No | Filter by category id. |
source.id | integer | No | Filter by source id. |
published_at.start | string | No | Start of period (ISO 8601 or YYYY-MM-DD). |
published_at.end | string | No | End of period (ISO 8601 or YYYY-MM-DD). |
api_key | string | Yes* | Your API key. Can also be provided via headers. |
* Required if not provided in headers
Each request costs 1 point.
Response Format
{
"status": "ok",
"count": 0,
"request_id": "string"
}Response Fields
| Field | Type | Description |
|---|---|---|
status | string | Always ok on success. |
count | integer | Number of articles matching the filters. |
request_id | string | Unique identifier for the request. |
Request Examples
GET with query filters
curl "https://api.apitube.io/v1/news/count?language.code=en&category.id=medtop:20000199&api_key=YOUR_API_KEY"POST with JSON body
curl -X POST "https://api.apitube.io/v1/news/count" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "climate change",
"language.code": "en",
"published_at.start": "2026-01-01"
}'Using Bearer token
curl -H "Authorization: Bearer YOUR_API_KEY" \
"https://api.apitube.io/v1/news/count?source.id=1024"Response Example
{
"status": "ok",
"count": 12345,
"request_id": "req_abc123def456"
}Error Responses
Invalid or Missing API Key
{
"status": "not_ok",
"request_id": "req_abc123def456",
"errors": [
{
"status": 401,
"code": "ER0175",
"message": "API key is invalid or missing.",
"links": { "about": "https://docs.apitube.io/platform/news-api/http-response-codes" },
"timestamp": "2026-05-24T14:30:00Z"
}
]
}Status Code: 401
No Points on Account
{
"status": "not_ok",
"request_id": "req_abc123def456",
"errors": [
{
"status": 402,
"code": "ER0176",
"message": "You have no points on your account.",
"links": { "about": "https://docs.apitube.io/platform/news-api/http-response-codes" },
"timestamp": "2026-05-24T14:30:00Z"
}
]
}Status Code: 402
Rate Limit Exceeded
{
"status": "not_ok",
"request_id": "req_abc123def456",
"errors": [
{
"status": 429,
"code": "ER0203",
"message": "Rate limit exceeded.",
"links": { "about": "https://docs.apitube.io/platform/news-api/http-response-codes" },
"timestamp": "2026-05-24T14:30:00Z"
}
]
}Status Code: 429