News API Quick Start: Your First Request in 5 Minutes

Jacob Partington

Jacob Partington

·

8 mins ler

News API Quick Start: Your First Request in 5 Minutes

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):

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

JavaScript (Node 18+ or browser):

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):

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:

{
  "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:

FieldWhat it isWhat you'd use it for
title, descriptionArticle headline + summaryDisplay in your UI
hrefOriginal article URLLink out so users can read the source
published_atISO 8601 timestampSort by recency, filter "last 24h"
source.domainPublisher domainGroup by source, build a credibility filter
language.codeTwo-letter languageFilter to en, de, etc.
categories[].scoreTopic confidence (0–1)Personalize, route to topic feeds
sentiment.overall.score-1 to +1Flag positive/negative coverage
has_next_pagesBooleanDecide 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:

StatusMeaningFix
401 UnauthorizedWrong or missing API keyRe-check the X-API-Key header value (no quotes around it, no leading space)
429 Too Many RequestsYou hit the free-tier rate limitWait 30 minutes, or add time.sleep(2) between calls
200 OK with empty resultsFilter too narrow / no recent matchesDrop 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:

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.

APITube - News API

Artigos relacionados

10 News API Filter Patterns You Should Know (2026)
Developer Guides

10 News API Filter Patterns You Should Know (2026)

10 padrões de filtro de API de notícias executáveis — pesquisa de título, datas, entidades, sentimento, fontes e consultas compostas — com exemplos curl, Python e JSON, mais a armadilha que desperdiça seu primeiro dia.

Bot de Notícias Telegram em Python (2026): aiogram APScheduler
Developer Guides

Bot de Notícias Telegram em Python (2026): aiogram APScheduler

Crie um bot de notícias Telegram em Python com aiogram 3.27, APScheduler e APITube. Assíncrono, com filtro de sentimento, postagem automática de canal — código completo Docker.

Build a Django News Portal in 2026: Full Stack Tutorial
Developer Guides

Build a Django News Portal in 2026: Full Stack Tutorial

Build a Django news portal: Celery beat ingestion, Redis cache, HTMX infinite scroll, Postgres full-text search. Real news API, runnable Django 5 code.

Next.js Multilingual App Tutorial 2026: UI + Content i18n
Developer Guides

Next.js Multilingual App Tutorial 2026: UI + Content i18n

Build a multilingual Next.js 16 app: next-intl for UI strings, APITube for content in 60+ languages, working hreflang and a multilingual sitemap. Server Components, RTL, and Vercel Edge deploy — free tier included.

Utilizamos cookies

Ao clicar em "aceitar", concorda com o armazenamento de cookies no seu dispositivo para fins funcionais e analíticos.