---
title: "News API Quick Start: Your First Request in 5 Minutes"
description: "Hit a real news API endpoint in 5 minutes — curl, JavaScript, and Python side by side, with an annotated JSON response and fixes for the 401/429 errors you'll actually hit."
source: https://apitube.io/blog/post/news-api-quick-start-first-request
---

# News API Quick Start: Your First Request in 5 Minutes

You want news data. You don't want to read a 30-page docs site first. Here's the smallest possible working request, in three languages, with the response explained.


**A News API quick start is a single authenticated HTTP GET request to the API's articles endpoint that returns the latest news headlines as JSON, usually finishing in under 5 minutes from signup to first response.** I'll use APITube as the example — they have a free tier that's enough to follow along — but the shape is the same for any REST news API. If you've never called a REST API before, you're in the right place.


> **TL;DR:** `GET https://api.apitube.io/v1/news/everything` with header `X-API-Key: YOUR_API_KEY`. Free tier = 30 requests / 30 minutes. Three-line `curl`, JS `fetch`, or Python `requests` examples below.


## What You'll Build

One HTTP GET that returns the latest 3 news articles. Five steps:

1. Get a free API key.
2. Build the URL.
3. Send the request (curl / JS / Python).
4. Read the response.
5. Add a search term.


## Step 1 — Get a Free API Key

To get a free News API key, sign up at apitube.io and copy the key from your dashboard. The free tier gives you **30 requests per 30 minutes** — plenty for a tutorial. Treat the key like a password: don't paste it into a public repo or a Dev.to comment.


## Step 2 — Build the URL

The endpoint is `https://api.apitube.io/v1/news/everything`. Add `?per_page=3` so you get back a small response that fits on one screen. Authentication goes in a header, not the URL: `X-API-Key: YOUR_API_KEY`.

Unlike APIs that put the key in the query string (e.g., `?apiKey=...`), APITube uses a header, which means the key won't show up in server logs or browser history when you test in the browser bar.


## Step 3 — Send the Request

Same call, three flavors. Pick whichever you'd actually run.

**curl** (terminal):

```bash
curl -H "X-API-Key: YOUR_API_KEY" \
  "https://api.apitube.io/v1/news/everything?per_page=3"
```

**JavaScript** (Node 18+ or browser):

```javascript
const res = await fetch(
  "https://api.apitube.io/v1/news/everything?per_page=3",
  { headers: { "X-API-Key": "YOUR_API_KEY" } }
);
const data = await res.json();
console.log(data.results);
```

**Python** (3.8+, `pip install requests`):

```python
import requests

r = requests.get(
    "https://api.apitube.io/v1/news/everything",
    headers={"X-API-Key": "YOUR_API_KEY"},
    params={"per_page": 3},
)
print(r.json()["results"])
```

All three send identical bytes over the wire. Same auth header, same query string, same response.


## Step 4 — Read the Response

A News API returns a JSON object with a `results[]` array of articles, each containing the headline, summary, source, timestamp, and (in APITube's case) topic and sentiment metadata. Trimmed example:

```json
{
  "results": [
    {
      "title": "Nvidia tops Q1 earnings as data-center revenue jumps",
      "description": "Chipmaker beats analyst estimates...",
      "href": "https://example.com/nvidia-q1",
      "published_at": "2026-05-03T08:14:22.000Z",
      "language": { "code": "en" },
      "source": { "domain": "reuters.com" },
      "categories": [
        { "id": "medtop:13000000", "name": "Technology", "score": 0.94 }
      ],
      "sentiment": { "overall": { "score": 0.41, "polarity": "positive" } }
    }
  ],
  "has_next_pages": true
}
```

What each field is actually for:

| Field | What it is | What you'd use it for |
|---|---|---|
| `title`, `description` | Article headline + summary | Display in your UI |
| `href` | Original article URL | Link out so users can read the source |
| `published_at` | ISO 8601 timestamp | Sort by recency, filter "last 24h" |
| `source.domain` | Publisher domain | Group by source, build a credibility filter |
| `language.code` | Two-letter language | Filter to `en`, `de`, etc. |
| `categories[].score` | Topic confidence (0–1) | Personalize, route to topic feeds |
| `sentiment.overall.score` | -1 to +1 | Flag positive/negative coverage |
| `has_next_pages` | Boolean | Decide whether to paginate |

You don't need all of these on day one. Start with `title` + `href` + `published_at`. Add the rest when you have a reason to.


## When It Doesn't Work

Three failures account for ~95% of "why isn't my code working" moments on day one:

| Status | Meaning | Fix |
|---|---|---|
| 401 Unauthorized | Wrong or missing API key | Re-check the `X-API-Key` header value (no quotes around it, no leading space) |
| 429 Too Many Requests | You hit the free-tier rate limit | Wait 30 minutes, or add `time.sleep(2)` between calls |
| 200 OK with empty `results` | Filter too narrow / no recent matches | Drop filters one at a time until results return |

If you see `200 OK` and `results: []`, the request worked — there's just nothing matching. That's not a bug.


## Your Next 30 Seconds

You have "hello world" running. The next call you'll want is "search for a keyword". Add `title=` to the same URL:

```bash
curl -H "X-API-Key: YOUR_API_KEY" \
  "https://api.apitube.io/v1/news/everything?per_page=3&title=tesla"
```

Same pattern in JavaScript and Python — just add `title: "tesla"` to your params object. From here, the docs at docs.apitube.io list everything else: filter by category, by language, by source, by sentiment polarity. All the same shape.


## Wrap

You hit a real news API, parsed the response, and learned what to do when it breaks — in under 5 minutes. APITube is one option; if you outgrow the free tier, the same three languages work against any REST news API. Grab a free key at apitube.io and run the curl above — first result in your terminal before your coffee's cold.
