# mediastack API reference

> mediastack, from APILayer, is a REST API that returns live and historical news articles as JSON, filterable by keyword, country, language, category, source and date. An investigator can use it to find press coverage of a name or topic. Base URL is https://api.mediastack.com/v1. The access key goes…

Source: https://osinttools.io/apis/mediastack/ (Markdown view of an OSINTtools.io page; append `.md` to any page URL for this format).

Compiled by OSINTtools.io editors from the vendor's docs, updated Nov 29, 2026. Listing: https://osinttools.io/tools/mediastack/

- Base URL: https://api.mediastack.com/v1
- Authentication: API key in the `access_key` query parameter. Get a key: https://mediastack.com/ The key is in the account dashboard.
- Free tier: yes
- Rate limits: Not stated in the docs
- Vendor docs: https://docs.apilayer.com/mediastack/docs/api-documentation

## Overview

mediastack, from APILayer, is a REST API that returns live and historical news articles as JSON, filterable by keyword, country, language, category, source and date. An investigator can use it to find press coverage of a name or topic.

Base URL is `https://api.mediastack.com/v1`. The access key goes in the `access_key` query parameter. The docs say there are free and paid plans; on the free plan live news is delayed 30 minutes, and historical news needs the Standard plan or higher.

The docs pages read do not list error codes or rate limits.

## News

### Search live news, or historical news when date is given.

`GET /news`

- Takes: Name
- Footprint: passive (the target is not contacted)
- Plan: Historical news needs Standard or higher

For historical news, date is required in YYYY-MM-DD form and a Standard plan or higher is needed. Prefix a value with - to exclude it.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `keywords` | query | string | no | Search phrase; prefix a word with - to exclude it Example: example corp |
| `sources` | query | string | no | Comma-separated source IDs Example: cnn,-bbc |
| `categories` | query | string | no | Comma-separated categories Example: business,technology |
| `countries` | query | string | no | Comma-separated country codes Example: us,gb |
| `languages` | query | string | no | Comma-separated language codes Example: en,de |
| `date` | query | string | no | YYYY-MM-DD, or two dates separated by a comma Example: 2026-01-01,2026-01-31 |
| `sort` | query | string | no | Sort order Example: published_desc One of: published_desc, published_asc, popularity |
| `limit` | query | integer | no | Results per page, maximum 100 Example: 25 |
| `offset` | query | integer | no | Number of results to skip Example: 0 |

Response fields:

- `pagination.limit` (integer): Page size used
- `pagination.offset` (integer): Offset used
- `pagination.count` (integer): Results on this page
- `pagination.total` (integer): Total results available
- `data[].author` (string): Article author
- `data[].title` (string): Article title
- `data[].description` (string): Article summary
- `data[].url` (string): Article URL
- `data[].image` (string): Image URL
- `data[].category` (string): Category
- `data[].language` (string): Language code
- `data[].country` (string): Country code
- `data[].published_at` (string): Publication time

```bash
curl 'https://api.mediastack.com/v1/news?access_key=YOUR_API_KEY'
```

Example response (200):

```json
{
  "pagination": {
    "limit": 25,
    "offset": 0,
    "count": 1,
    "total": 1
  },
  "data": [
    {
      "author": "Jane Example",
      "title": "Example headline",
      "description": "Example summary.",
      "url": "https://example.com/news/1",
      "image": "https://example.com/1.jpg",
      "category": "business",
      "language": "en",
      "country": "us",
      "published_at": "2026-01-02T10:00:00+00:00"
    }
  ]
}
```

## Sources

### Search the news sources the API covers.

`GET /sources`

- Footprint: passive (the target is not contacted)

Use the returned id in the sources parameter of /news.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `search` | query | string | yes | Search text Example: example |
| `countries` | query | string | no | Country codes Example: us |
| `languages` | query | string | no | Language codes Example: en |
| `categories` | query | string | no | Categories Example: general |
| `limit` | query | integer | no | Results per page Example: 25 |
| `offset` | query | integer | no | Results to skip Example: 0 |

Response fields:

- `data[].id` (string): Source ID to pass to the sources parameter
- `data[].name` (string): Source name
- `data[].category` (string): Category
- `data[].country` (string): Country code
- `data[].language` (string): Language code
- `data[].url` (string): Source website

```bash
curl 'https://api.mediastack.com/v1/sources?search=example&access_key=YOUR_API_KEY'
```

Example response (200):

```json
{
  "data": [
    {
      "id": "examplenews",
      "name": "Example News",
      "category": "general",
      "country": "us",
      "language": "en",
      "url": "https://example.com"
    }
  ]
}
```

---

Listings on OSINTtools.io are reviewed by editors and re-verified on a schedule; check pricing and availability on the vendor's site before relying on them, and use OSINT tools only with a lawful basis.
Site index for agents: https://osinttools.io/llms.txt · Full catalog: https://osinttools.io/llms-full.txt · MCP server (Streamable HTTP, no auth): https://osinttools.io/mcp/
