News & MediaDifficulty: Easy

AP News Data Extraction

Extract publicly available data from AP News at scale using AlterLab's API — JavaScript rendering, structured extraction, and automatic retries in one request.

Automatic renderingJavaScript supportStructured data extractionChallenge resolution

Website Compatibility Notes

AP News has light bot protections. Most article pages serve well-structured content that renders reliably with basic JavaScript support. AP News is the Associated Press's public news portal with generally permissive access to its published articles.

Technical Context

AP News article URLs follow /article/{article-slug} pattern. AP News (Associated Press) articles are widely syndicated across thousands of news sites. The AP News website itself publishes the canonical version without paywalls. AP News content is factual and wire-service style — structured with dateline, lead paragraph, and inverted pyramid format — making it consistently parseable.

Common Data Fields

Typical fields available when extracting data from AP News:

Article headline
Article body text (full)
Publication date and time
Author byline
AP section/hub
Article tags
Related articles
Image captions
Dateline (news origin location)

Responsible Use

AlterLab is designed for extracting publicly available data. Always review the terms of service for any website you access, respect robots.txt directives, and ensure your use case complies with applicable laws in your jurisdiction. Do not use this service to access non-public, authenticated, or personally identifiable data without appropriate authorization.

Quick Start — Extract from AP News

cURL
# Always verify the target site's robots.txt and terms of service before extracting data.
curl -X POST https://alterlab.io/api/v1/scrape \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://apnews.com/article/example-story-slug",
    "advanced": { "render_js": true }
  }'

Need an API key? — no credit card required.

Python Example

Python
import requests

# Always verify the target site's robots.txt and terms of service before extracting data.
response = requests.post(
    "https://alterlab.io/api/v1/scrape",
    headers={
        "X-API-Key": "YOUR_API_KEY",
        "Content-Type": "application/json",
    },
    json={
        "url": "https://apnews.com/article/example-story-slug",
        "advanced": {"render_js": True},
    },
)

data = response.json()
print(data["content"][:500])  # First 500 chars of extracted content

Frequently Asked Questions

How do I extract AP News articles?

Send AP News article URLs to AlterLab with JavaScript rendering. You'll receive headlines, article body text, publication dates, author names, and associated media descriptions.

Can I extract AP News topic pages?

Yes. AlterLab renders AP News topic and hub pages, returning article headlines, summaries, timestamps, and bylines for each story in the topic collection.

What makes AP News good for data extraction?

AP News provides clean, well-structured article content with consistent HTML patterns, making extraction reliable. Articles include clear metadata like dates, authors, and topic tags.

Is AP News content behind a paywall?

No. AP News (apnews.com) is the Associated Press's free public news portal. All articles are freely accessible without subscription. This makes it one of the more straightforward news sites for systematic data collection.

How do I collect AP News stories by topic or region?

AP News organizes content by topic hubs (apnews.com/hub/{topic}) and geographic hubs (apnews.com/hub/us-news, apnews.com/hub/world-news). AlterLab renders these hub pages and returns the current article list for each section.

What is the dateline in AP News articles and why is it useful?

The dateline indicates where the news originated (e.g., 'WASHINGTON' or 'TOKYO'). It appears at the beginning of the article body. When collecting AP News at scale, the dateline is useful for geographic filtering and building location-tagged news datasets.

Related Use Cases

Business Data Guide

Your first scrape.
Sixty seconds.

$1 free credit — up to 5,000 scrapes. No credit card.Just a POST request.

terminal
curl -X POST https://api.alterlab.io/v1/scrape \
-H "X-API-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com", "formats": ["markdown"]}'

No credit card required · $1 free credit, up to 5,000 scrapes · Balance never expires

    Scrape AP News Data in 2026 — Anti-Bot Bypass | AlterLab