# NewsAPI

News API is a simple HTTP REST API for searching and retrieving live articles from all over the web.

- **Category:** news & lifestyle
- **Auth:** API_KEY
- **Composio Managed App Available?** N/A
- **Tools:** 4
- **Triggers:** 0
- **Slug:** `NEWS_API`
- **Version:** 20260316_00

## Tools

### Get Everything

**Slug:** `NEWS_API_GET_EVERYTHING`

Tool to search through every article published by over 150,000 sources. At least one of q, sources, language, or domains must be set or the API returns a parametersMissing error. Historical date range depends on your News API plan tier (free plans limited to ~1 month). No country parameter exists; target geography via sources, domains, or country-specific terms in q. Burst requests may trigger HTTP 429; apply backoff on throttling errors.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `q` | string | No | Keywords or phrases to search for in the article title and body |
| `to` | string | No | Newest date or date-time for articles (YYYY-MM-DD or YYYY-MM-DDThh:mm:ss). Date range limits depend on your News API plan tier (free plans are limited to approximately 1 month of historical data) |
| `from` | string | No | Oldest date or date-time for articles (YYYY-MM-DD or YYYY-MM-DDThh:mm:ss). Date range limits depend on your News API plan tier (free plans are limited to approximately 1 month of historical data) |
| `page` | integer | No | Page number of results to return (default 1) When totalResults exceeds pageSize, increment page to retrieve additional results. |
| `sortBy` | string ("relevancy" | "popularity" | "publishedAt") | No | Order to sort articles: relevancy, popularity, or publishedAt |
| `domains` | string | No | Comma-separated list of domains to include in results |
| `sources` | string | No | Comma-separated list of source identifiers to filter on Use valid source IDs from NEWS_API_GET_SOURCES; unrecognized IDs silently return empty results. |
| `language` | string ("ar" | "de" | "en" | "es" | "fr" | "he" | "it" | "nl" | "no" | "pt" | "ru" | "sv" | "ud" | "zh") | No | 2-letter ISO-639-1 code to restrict the search to that language |
| `pageSize` | integer | No | Number of results per page (default 20, max 100) |
| `qInTitle` | string | No | Keywords or phrases to search for in the article title only |
| `excludeDomains` | string | No | Comma-separated list of domains to exclude from results |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Sources

**Slug:** `NEWS_API_GET_SOURCES`

Tool to fetch available news sources. Use when you need to retrieve a list of publishers by optional filters like category, language, or country. Source IDs returned here are the only valid IDs for filtering in NEWS_API_GET_EVERYTHING or NEWS_API_GET_TOP_HEADLINES — unrecognized IDs cause silently empty results.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `country` | string ("ae" | "ar" | "at" | "au" | "be" | "bg" | "br" | "ca" | "ch" | "cn" | "co" | "cu" | "cz" | "de" | "eg" | "fr" | "gb" | "gr" | "hk" | "hu" | "id" | "ie" | "il" | "in" | "is" | "it" | "jp" | "kr" | "lt" | "lv" | "ma" | "mx" | "my" | "ng" | "nl" | "no" | "nz" | "ph" | "pl" | "pt" | "ro" | "rs" | "ru" | "sa" | "se" | "sg" | "si" | "sk" | "th" | "tr" | "tw" | "ua" | "us" | "ve" | "za") | No | Filter sources by this country code. |
| `category` | string ("business" | "entertainment" | "general" | "health" | "science" | "sports" | "technology") | No | Filter sources by this news category. |
| `language` | string ("ar" | "de" | "en" | "es" | "fr" | "he" | "it" | "nl" | "no" | "pt" | "ru" | "se" | "ud" | "zh") | No | Filter sources by this language code. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get Top Headlines

**Slug:** `NEWS_API_GET_TOP_HEADLINES`

Tool to retrieve live top and breaking headlines; does not support historical or date-bounded queries (use NEWS_API_GET_EVERYTHING for past date ranges). Results favor major outlets; use NEWS_API_GET_EVERYTHING or COMPOSIO_SEARCH_WEB for niche publications. Use when you need current headlines filtered by country, category, source(s), or keywords.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `q` | string | No | Keywords or phrase to search for in the article title and body. At least one of 'country', 'category', 'sources', or 'q' must be provided. |
| `page` | integer | No | Page number for pagination. Default is 1. |
| `country` | string ("ae" | "ar" | "at" | "au" | "be" | "bg" | "br" | "ca" | "ch" | "cn" | "co" | "cu" | "cz" | "de" | "eg" | "fr" | "gb" | "gr" | "hk" | "hu" | "id" | "ie" | "il" | "in" | "it" | "jp" | "kr" | "lt" | "lv" | "ma" | "mx" | "my" | "ng" | "nl" | "no" | "nz" | "ph" | "pl" | "pt" | "ro" | "rs" | "ru" | "sa" | "se" | "sg" | "si" | "sk" | "th" | "tr" | "tw" | "ua" | "us" | "ve" | "za") | No | 2-letter ISO 3166-1 code of the country to get headlines for. At least one of 'country', 'category', 'sources', or 'q' must be provided. Cannot be used with 'sources'. |
| `sources` | string | No | Comma-separated list of source identifiers to include (max 20). At least one of 'country', 'category', 'sources', or 'q' must be provided. Cannot be combined with 'country' or 'category'. Use valid source IDs from NEWS_API_GET_SOURCES; unrecognized IDs may silently return empty results. |
| `category` | string ("business" | "entertainment" | "general" | "health" | "science" | "sports" | "technology") | No | News category to filter by. At least one of 'country', 'category', 'sources', or 'q' must be provided. Cannot be used with 'sources'. |
| `pageSize` | integer | No | Number of results per page. Default is 20, max is 100. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |

### Get V1 Articles

**Slug:** `NEWS_API_GET_V1_ARTICLES`

Tool to fetch live article metadata from a news source using the legacy v1 API. Use when you need headlines from a specific source identifier. This v1 endpoint has been superseded by /v2/top-headlines.

#### Input Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `sortBy` | string ("top" | "latest" | "popular") | No | Sort order for articles. |
| `source` | string | Yes | The identifier for the news source or blog you want headlines from. Use the /sources endpoint to locate this. |

#### Output

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `data` | string | Yes | Data from the action execution |
| `error` | string | No | Error if any occurred during the execution of the action |
| `successful` | boolean | Yes | Whether or not the action execution was successful or not |
