Make Your First API Call
This guide will walk you through making your first request to the APITube News API. By the end, you will have fetched real news articles and learned how to filter them by language, topic, date, and more.
What is APITube News API?
APITube is a RESTful news API that gives you access to articles from more than 500,000 verified news sources worldwide. With a single HTTP request you can:
- Search articles by title, keyword, language, category, topic, or industry
- Filter by date range, country, source, author, entity (people, organizations, brands)
- Analyze sentiment at the article, title, and body level
- Export results as JSON, CSV, XLSX, XML, RSS, Parquet, or JSONL
- Stream articles in real time via Server-Sent Events (SSE)
The API is free to use for development — you just need an API key.
Prerequisites
Before you start, you need three things:
- An APITube account — sign up for free if you haven't already.
- Your API key — after registration, copy the API key from your dashboard.
- A terminal — curl is pre-installed on macOS and Linux. On Windows, use PowerShell or install curl.
TIP
Your API key is a long alphanumeric string. Keep it secret — do not share it publicly or commit it to version control.
Step 1: Make Your First Request
Open your terminal and run this command:
curl -H "X-API-Key: YOUR_API_KEY" "https://api.apitube.io/v1/news/everything?per_page=3"Let's break down what each part does:
| Part | Meaning |
|---|---|
curl | Command-line tool for making HTTP requests |
-H "X-API-Key: YOUR_API_KEY" | Sends your API key in the request header for authentication |
https://api.apitube.io | APITube base URL |
/v1/news/everything | Endpoint that returns articles from all sources |
?per_page=3 | Limits the response to 3 articles |
TIP
Replace YOUR_API_KEY with the actual key from your dashboard.
Step 2: Understand the Response
You will receive a JSON response like this:
{
"status": "ok",
"limit": 3,
"path": "https://api.apitube.io/v1/news/everything?per_page=3",
"page": 1,
"has_next_pages": true,
"next_page": "https://api.apitube.io/v1/news/everything?per_page=3&page=2",
"has_previous_page": false,
"previous_page": "",
"export": {
"json": "https://api.apitube.io/v1/news/everything?per_page=3&export=json",
"xlsx": "https://api.apitube.io/v1/news/everything?per_page=3&export=xlsx",
"csv": "https://api.apitube.io/v1/news/everything?per_page=3&export=csv",
"tsv": "https://api.apitube.io/v1/news/everything?per_page=3&export=tsv",
"xml": "https://api.apitube.io/v1/news/everything?per_page=3&export=xml",
"rss": "https://api.apitube.io/v1/news/everything?per_page=3&export=rss",
"parquet": "https://api.apitube.io/v1/news/everything?per_page=3&export=parquet",
"jsonl": "https://api.apitube.io/v1/news/everything?per_page=3&export=jsonl"
},
"request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"results": [
{
"id": 987654321,
"href": "https://example.com/article/tech-conference",
"published_at": "2026-03-25T10:30:00Z",
"title": "Global Tech Conference Announces New AI Initiatives",
"description": "Leading technology companies gathered to discuss the future of artificial intelligence and its impact on various industries.",
"body": "The annual Global Tech Conference kicked off today with a series of announcements focused on artificial intelligence...",
"body_html": "<p>The annual Global Tech Conference kicked off today with a series of announcements focused on artificial intelligence...</p>",
"language": {
"code": "en",
"name": "English"
},
"author": {
"id": "author-456",
"name": "Jane Smith"
},
"image": "https://example.com/images/tech-conference.jpg",
"categories": [
{
"id": "technology",
"name": "Technology",
"score": 0.95,
"taxonomy": "iab",
"links": {
"self": "https://api.apitube.io/v1/news/category?category.id=technology"
}
}
],
"topics": [
{
"id": "artificial-intelligence",
"name": "Artificial Intelligence",
"score": 0.92,
"links": {
"self": "https://api.apitube.io/v1/news/topic?topic.id=artificial-intelligence"
}
}
],
"industries": [
{
"id": "information-technology",
"name": "Information Technology",
"links": {
"self": "https://api.apitube.io/v1/news/industry?industry.id=information-technology"
}
}
],
"entities": [
{
"id": "google",
"name": "Google",
"type": "organization",
"links": {
"self": "https://api.apitube.io/v1/news/entity?entity.id=google",
"wikipedia": "https://en.wikipedia.org/wiki/Google",
"wikidata": "https://www.wikidata.org/wiki/Q95"
},
"frequency": 5,
"title": {
"pos": []
},
"body": {
"pos": [12, 45, 78, 134, 201]
}
}
],
"source": {
"id": "example-com",
"domain": "example.com",
"home_page_url": "https://example.com",
"type": "news",
"bias": "center",
"rankings": {
"opr": 82
},
"location": {
"country_name": "United States",
"country_code": "US"
},
"favicon": "https://example.com/favicon.ico"
},
"sentiment": {
"overall": {
"score": 0.85,
"polarity": "positive"
},
"title": {
"score": 0.78,
"polarity": "positive"
},
"body": {
"score": 0.87,
"polarity": "positive"
}
},
"summary": [
{
"sentence": "The annual Global Tech Conference kicked off today with major AI announcements.",
"sentiment": {
"score": 0.82,
"polarity": "positive"
}
},
{
"sentence": "Industry leaders committed to responsible AI development standards.",
"sentiment": {
"score": 0.90,
"polarity": "positive"
}
}
],
"keywords": ["technology", "artificial intelligence", "conference", "AI", "innovation"],
"links": [
{
"url": "https://example.com/ai-standards",
"type": "link"
}
],
"media": [
{
"url": "https://example.com/images/tech-conference.jpg",
"type": "image"
}
],
"story": {
"id": "story-789",
"uri": "https://api.apitube.io/v1/news/story?story.id=story-789"
},
"shares": {
"total": 1250,
"facebook": 450,
"twitter": 600,
"reddit": 200
},
"is_duplicate": false,
"is_free": true,
"is_breaking": false,
"read_time": 4,
"sentences_count": 18,
"paragraphs_count": 6,
"words_count": 542,
"characters_count": 3210
}
]
}Here are the key fields to pay attention to:
| Field | Description |
|---|---|
status | "ok" if the request was successful, "error" otherwise |
results | Array of article objects — the main data |
results[].title | Article headline |
results[].description | Short article summary |
results[].href | URL of the original article |
results[].published_at | Publication date in ISO 8601 format |
results[].language.code | Two-letter language code (e.g. en, de, fr) |
results[].categories | Article categories with relevance scores |
results[].entities | People, organizations, brands mentioned in the article |
results[].sentiment | Sentiment analysis — overall, title, and body separately |
results[].source | Information about the news source (domain, country, ranking) |
results[].summary | Key sentences extracted from the article |
export | URLs to download the same results as JSON, CSV, XLSX, XML, RSS, Parquet, or JSONL |
has_next_pages | true if there are more results — use page parameter to paginate |
request_id | Unique ID for debugging — include it if you contact support |
For a complete description of every field, see the API Response Structure page.
Step 3: Add Filters
The real power of the API is in filtering. Here are progressively more specific queries:
Filter by language
Get only English-language articles:
curl -H "X-API-Key: YOUR_API_KEY" "https://api.apitube.io/v1/news/everything?language.code=en&per_page=5"Search by title
Find articles with "climate" in the title:
curl -H "X-API-Key: YOUR_API_KEY" "https://api.apitube.io/v1/news/everything?title=climate&language.code=en&per_page=5"Filter by date range
Narrow results to a specific time period:
curl -H "X-API-Key: YOUR_API_KEY" "https://api.apitube.io/v1/news/everything?title=climate&language.code=en&published_at.start=2026-03-01&published_at.end=2026-03-25&per_page=5"Filter by category
Get articles from the "technology" category:
curl -H "X-API-Key: YOUR_API_KEY" "https://api.apitube.io/v1/news/everything?category.id=technology&language.code=en&per_page=5"You can combine any of these filters together. See the full Parameters reference for all available options.
Step 4: Try It in Python
Here is the same request using Python and the requests library:
import requests
url = "https://api.apitube.io/v1/news/everything"
headers = {
"X-API-Key": "YOUR_API_KEY"
}
params = {
"title": "climate",
"language.code": "en",
"per_page": 5
}
response = requests.get(url, headers=headers, params=params)
data = response.json()
print(f"Status: {data['status']}")
print(f"Found {len(data['results'])} articles\n")
for article in data["results"]:
print(f"- {article['title']}")
print(f" {article['href']}\n")TIP
Install the requests library with pip install requests if you don't have it yet.
Step 5: Try It in JavaScript
Using the built-in fetch API (Node.js 18+ or any modern browser):
const API_KEY = 'YOUR_API_KEY';
const params = new URLSearchParams({
title: 'climate',
'language.code': 'en',
per_page: '5'
});
const response = await fetch(
`https://api.apitube.io/v1/news/everything?${params}`,
{ headers: { 'X-API-Key': API_KEY } }
);
const data = await response.json();
console.log(`Status: ${data.status}`);
console.log(`Found ${data.results.length} articles\n`);
data.results.forEach(article => {
console.log(`- ${article.title}`);
console.log(` ${article.href}\n`);
});Common Errors
If something goes wrong, check the HTTP status code:
| HTTP Code | Meaning | What to Do |
|---|---|---|
401 | Invalid or missing API key | Check that the X-API-Key header is present and the key is correct |
402 | No points on account | Top up your account balance |
429 | Rate limit exceeded | Wait and retry — see limits below |
400 | Malformed request | Check your parameter names and values |
WARNING
The free plan allows 30 requests per 30 minutes and returns only the first page of results. If you need higher limits, consider upgrading your plan.
Next Steps
Now that you have made your first API call, explore further:
- Authentication — all authentication methods in detail
- Endpoints — all available API endpoints
- Parameters — full list of filters and options
- Integration examples — code snippets in 30+ programming languages
- Common Workflows — real-world usage patterns and examples
- Interactive Query Builder — build API queries visually
- Rate Limits — understand plan limits and quotas
- Postman Collection — explore the API interactively in Postman
TIP
If you have any questions or need assistance, reach out to the support team.