The Guardian API
content.guardianapis.com · Media
Access all Guardian content since 1999 — 2.4M+ articles, galleries, videos, and podcasts. Filter by section, contributor, keyword, and date. Free tier: 500 requests/day.
Authentication
Sample Requests
Search Guardian articles by keyword.
Hover any highlighted part to learn what it does
curl -X GET "https://content.guardianapis.com/search?q=climate%20change&api-key=YOUR_KEY&page-size=5&show-fields=headline%2Cbyline%2Cthumbnail"
import requests
params = {
"q": "climate change",
"api-key": "YOUR_KEY",
"page-size": "5",
"show-fields": "headline,byline,thumbnail"
}
response = requests.get(
"https://content.guardianapis.com/search",
params=params,
)
print(response.json())const url = new URL('https://content.guardianapis.com/search');
url.searchParams.set('q', 'climate change');
url.searchParams.set('api-key', 'YOUR_KEY');
url.searchParams.set('page-size', '5');
url.searchParams.set('show-fields', 'headline,byline,thumbnail');
const response = await fetch(url);
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://content.guardianapis.com/search")
q := baseURL.Query()
q.Set("q", "climate change")
q.Set("api-key", "YOUR_KEY")
q.Set("page-size", "5")
q.Set("show-fields", "headline,byline,thumbnail")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://content.guardianapis.com/search")
uri.query = URI.encode_www_form({
"q" => "climate change",
"api-key" => "YOUR_KEY",
"page-size" => "5",
"show-fields" => "headline,byline,thumbnail"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://content.guardianapis.com/search?" . http_build_query([
"q" => "climate change",
"api-key" => "YOUR_KEY",
"page-size" => "5",
"show-fields" => "headline,byline,thumbnail"
]);
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Get the latest technology articles.
Hover any highlighted part to learn what it does
curl -X GET "https://content.guardianapis.com/technology?api-key=YOUR_KEY&page-size=5"
import requests
params = {
"api-key": "YOUR_KEY",
"page-size": "5"
}
response = requests.get(
"https://content.guardianapis.com/technology",
params=params,
)
print(response.json())const url = new URL('https://content.guardianapis.com/technology');
url.searchParams.set('api-key', 'YOUR_KEY');
url.searchParams.set('page-size', '5');
const response = await fetch(url);
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://content.guardianapis.com/technology")
q := baseURL.Query()
q.Set("api-key", "YOUR_KEY")
q.Set("page-size", "5")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://content.guardianapis.com/technology")
uri.query = URI.encode_www_form({
"api-key" => "YOUR_KEY",
"page-size" => "5"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://content.guardianapis.com/technology?" . http_build_query([
"api-key" => "YOUR_KEY",
"page-size" => "5"
]);
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Postman Setup Guide
- Get a free API key at open-platform.theguardian.com
- Pass api-key=YOUR_KEY on every request
- Try GET https://content.guardianapis.com/search?q=AI&api-key=YOUR_KEY&page-size=5
- Add show-fields=headline,byline,thumbnail,body for richer responses
What can you build with The Guardian API?
The Guardian API is a Media API. Developers commonly use media APIs for:
- storing and delivering images, video, and audio
- building digital asset management and media libraries
- transcoding and optimising media for the web
- adding video streaming and playback to your app
- automating content tagging and metadata extraction
API Key authentication. You'll receive a key after signing up. Send it with every request — in a header or query parameter. Keep it out of client-side code and never commit it to version control. The Guardian API is free to use up to a usage limit, making it a low-risk choice to experiment with.
New to APIs? Read our beginner's guide