canonical: https://jentic.com/apis/mediastack.com/mediastack

# Mediastack API

Jentic maintains a curated, agent-optimized OpenAPI specification for Mediastack API, validated against the live API. APILayer, which operates Mediastack, also publishes an official Mediastack OpenAPI document on SwaggerHub at `https://api.swaggerhub.com/apis/apilayer-863/MediastackAPI/1.0.0/swagger.json`; it describes the same two operations as ours, so the curated version is kept for agent tooling rather than substituted. Mediastack is a real-time and historical news data API that aggregates live news articles and headlines from over 7,500 sources across 50+ countries in 13 languages. The API exposes two endpoints: /news for searching articles by keywords, dates, languages, categories, countries, and sources, and /sources for listing available publishers. Use it to enrich agent answers with current news, build news dashboards, or feed content models with topical text.

## For AI agents

Search live and historical news articles by keyword, country, language, category, and source so an agent can ground its answers in current journalism.

## Scope

Does not handle web crawling, social media posts, or full article-text licensing - use for structured news article search and source discovery only.

## Capabilities

- Search news articles by free-text keyword across 7,500+ sources
- Filter articles by ISO country code, language, and category such as business or technology
- Page through historical news using date ranges and offset-limit pagination
- List available news sources by language and country to discover what is searchable
- Sort results with the sort parameter by published_desc, published_asc, or popularity
- Restrict or exclude specific source IDs to control trust and bias in the article feed

## Use cases

### Brand and Reputation Monitoring

Track every news mention of a brand, executive, or product across 7,500+ international sources without scraping individual outlets. Mediastack returns structured article objects with publication date, source, country, language, and a snippet, which makes it straightforward to dedupe coverage and roll up sentiment downstream. PR teams use this to flag emerging stories within minutes of publication.

Example prompt: Call /news with keywords=Acme Corp, languages=en, sort=published_desc, and date set to the current date in YYYY-MM-DD format, then return the article titles, sources, and URLs whose published_at falls in the last six hours.

### AI Agent Grounding for Current Events

Give a research agent up-to-the-minute news context so its answers are not stuck at the model's training cutoff. The /news endpoint returns recent articles filtered by topic, language, and country, which the agent can summarise inline. This pattern lifts factuality on questions about ongoing events without exposing the agent to arbitrary web scraping.

Example prompt: Search Mediastack for keywords=climate summit and languages=en limited to the last 48 hours, then summarise the three most-cited stories with their source URLs.

### Topical Content Curation

Feed a newsletter or internal briefing with curated articles by topic, country, and language without manually scanning each outlet. Mediastack's category filter (general, business, entertainment, health, science, sports, technology) and country filter let an agent assemble a tightly scoped reading list per audience segment. This compresses hours of editorial scanning into a single API call per audience.

Example prompt: Fetch business-category news for countries=us,gb in English published today, dedupe by URL, and return the top 10 by source authority for inclusion in the morning briefing.

### Multilingual Market Intelligence

Search for industry signals in 13 languages so a market-intelligence agent does not miss non-English-language coverage of competitors and regulators. The /sources endpoint helps the agent confirm coverage in each market before searching, and /news returns articles tagged with language and country for downstream filtering. This is especially useful for regulated industries where regional press breaks news first.

Example prompt: Use /sources to list news sources for country=de language=de, then call /news with keywords=Bundeskartellamt and languages=de for the last seven days and return the unique sources covering it.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | /news | Search live and historical news articles |
| GET | /sources | List available news sources |

## Key resources

- **News** — Search live and historical news articles by keyword, language, country, category, source, and date
- **Sources** — List available news publishers filterable by language and country

## Why Jentic

- **Setup:** Wiring the Mediastack API by hand means sending your access_key as a query parameter, pointing at the api.mediastack.com/v1 host, and mapping the news and sources calls yourself. Through Jentic you install once, import the Mediastack API from the API Directory, store the access key once, and your agent calls it.
- **Permission scoping:** Mediastack filters news and sources through query parameters rather than resource ids in the URL path, so you limit the agent to the operations it needs, such as searching news or discovering sources. It calls only the operations you allow, and since this surface is read-only, it retrieves articles without any write access.
- **Credential handling:** Your Mediastack access_key is stored once, encrypted, by your own Jentic One instance and injected as the query parameter at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'find recent news about a topic', and Jentic returns the matching Mediastack news operation with its parameter schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **NewsAPI** — NewsAPI provides a similar global news search with comparable filters and a generous free tier.
- **GNews API** — GNews offers Google News-derived article search with built-in deduplication.
- **Currents API** — Currents API focuses on latest news with category and language tags.
- **OpenAI API** — Use OpenAI to summarise or classify the article text returned by Mediastack.

## FAQ

### Is there a Mediastack MCP server?

You do not need an MCP server to give your agent Mediastack. Jentic connects it directly from the API Directory: import Mediastack, store your access key once, and your agent can search news articles and list sources without loading another server's tool definitions into its context.

### What authentication does the Mediastack API use?

Mediastack uses an API key passed as the access_key query parameter. Through Jentic the key is stored encrypted in the vault and injected at execution time, so the agent never sees the raw value.

### Can I retrieve historical news articles with the Mediastack API?

Yes, on a paid plan. The /news endpoint accepts a date filter that takes either a single date or a comma-separated range, and Mediastack's pricing page lists Historical Data on the Standard, Professional, Business and Enterprise plans but not on Free. The Free plan card lists Delayed News Data, so the free plan returns neither historical articles nor live ones.

### What are the rate limits for the Mediastack API?

Volume is tied to plan. Mediastack's pricing page lists the Free plan at 100 calls per month, Standard at 10,000, Professional at 50,000 and Business at 250,000, with custom Enterprise volume on request. HTTPS encryption is listed on every plan including Free, while live news data and historical data begin at Standard, so check your plan before scaling agent calls.

### How do I search news for a topic through Jentic?

Search Jentic for search news articles, load the schema for the /news operation, and execute with keywords, languages, and date parameters. Jentic returns the article list with title, source, URL, and published_at fields ready for the agent to summarise.

### Which languages and countries does Mediastack cover?

Mediastack covers 13 languages including English, German, Spanish, French, Italian, and Portuguese, sourced from publishers across more than 50 countries. Use /sources with the languages and countries filters to enumerate exactly which publishers are available before searching.

### Can I limit what my agent is allowed to do with the Mediastack API?

Yes. Because you run Jentic One yourself, your own rules decide which Mediastack operations and credentials the agent may use, so you can allow only the calls it needs, such as searching news with /news or listing publishers with /sources. Mediastack filters requests through query parameters rather than resource IDs in the URL path, and the whole surface is read-only, so a scoped agent retrieves articles and sources without any write access. The agent calls only the operations you permit and nothing else.
