Getting Started

Introduction

Our API was developed to provide global news from thousands of sources with exceptional response times. On average we add over 1 million articles weekly, so you will never be short of content. Even better, it is completely free!

To get started simply sign up and use your API token in any of the available API endpoints documented below for instant access.

If you have any questions or concerns, feel free to contact us.

Authentication

As mentioned above, when you sign up for free you will find your API token on your dashboard. Simply add this to any of our API endpoints as a GET parameter to gain access. Examples of how this is done can be found below.

API Endpoints

Headlines Available on: Standard plan and above

Endpoint

            
                GET https://api.thenewsapi.com/v1/news/headlines HTTP/1.1
            
        

Use this endpoint to find get the latest headlines by category along with similar articles, allowing you to create the perfect news aggregation page similar to Google News .

If you have issues with your requests, please ensure your GET parameters are URL-encoded.

All text data returned is UTF-8.

All dates are in UTC (GMT).

HTTP GET Parameters

name required description
api_token true Your API token which can be found on your account dashboard.
locale false Comma separated list of country codes to include in the result set. Default is all countries. Click here for a list of supported countries.
Example: us,ca (US + Canada).
domains false Comma separated list of domains to include. List of domains can be obtained through our Sources endpoint, found further down this page.
exclude_domains false Comma separated list of domains to exclude
source_ids false Comma separated list of source_ids to include. List of source_ids can be obtained through our Sources endpoint, found further down this page.
exclude_source_ids false Comma separated list of source_ids to exclude.
language false Comma separated list of languages to include. Default is all.
Click here for a list of supported languages.
Examples: en,es (English + Spanish)
published_on false Find headlines for articles published on the specified date. Supported formats include: Y-m-d.
Examples: 2024-07-27
headlines_per_category false Specify the number of articles you want to return per category. The maximum is 10 and the default is 6.
include_similar false Specify if you wish to include similar articles with each base article. Default is true.

Response Objects

name description
data > uuid The unique identifier for an article in our system. Store this and use it to find specific articles using our single article endpoint.
data > title The article title.
data > description The article meta description.
data > keywords The article meta keywords.
data > snippet The first 60 characters of the article body.
data > url The URL to the article.
data > image_url The URL to the article image.
data > language The language of the source.
data > published_at The datetime the article was published.
data > source The domain of the source.
data > categories Array of strings which the source is categorized as.
data > locale Locale of the source.
data > similar An array of similar articles to the base article.

If no results are found, the data object will be empty.

Example Request

            
                GET https://api.thenewsapi.com/v1/news/headlines?locale=us&language=en&api_token=YOUR_API_TOKEN
            
        

Example Response

            
                {
    "data": {
        "general": [
            {
                "uuid": "890a1c8d-8036-44c1-8798-6985f4221b20",
                "title": "Poll: Harris-Biden Switch Fails to Change Race with Trump in Pennsylvania",
                "description": "Former President Donald Trump and Vice President Kamala Harris are neck-and-neck in Pennsylvania, according to a poll.",
                "keywords": "",
                "snippet": "Former President Donald Trump and Vice President Kamala Harris are neck and neck in Pennsylvania, with results nearly identical to when President Joe Biden was ...",
                "url": "https://www.breitbart.com/2024-election/2024/07/26/poll-harris-biden-switch-fails-to-change-contours-of-race-in-pennsylvania-trump-harris-neck-and-neck/",
                "image_url": "https://media.breitbart.com/media/2024/07/AP24207500957882-640x335.jpg",
                "language": "en",
                "published_at": "2024-07-26T23:56:58.000000Z",
                "source": "breitbart.com",
                "categories": [
                    "general",
                    "politics"
                ],
                "locale": "us",
                "similar": [
                    {
                        "uuid": "663a18fd-3b69-4329-89ed-8b2ea9d75c01",
                        "title": "Fox News Poll: Dead heat between Harris and Trump in Michigan",
                        "description": "Former President Donald Trump and Vice President Kamala Harris are tied in Michigan, according to a new Fox News poll conducted after Biden dropped out of the race.",
                        "keywords": "",
                        "snippet": "The presidential contest between Vice President Kamala Harris and former President Donald Trump is tied in Michigan, a state widely seen as a \"must have\" for De...",
                        "url": "https://www.foxnews.com/politics/fox-news-poll-dead-heat-between-harris-trump-michigan",
                        "image_url": "https://static.foxnews.com/foxnews.com/content/uploads/2024/07/HARRIS-TRUMP.jpg",
                        "language": "en",
                        "published_at": "2024-07-26T22:00:04.000000Z",
                        "source": "foxnews.com",
                        "categories": [
                            "general",
                            "politics"
                        ],
                        "locale": "us"
                    },
                    {
                        "uuid": "df037181-0130-42ec-837d-8bc523e0bcab",
                        "title": "Fox News Poll: Harris bests Trump by 6 points in Minnesota",
                        "description": "Likely Democratic nominee Vice President Kamala Harris is leading former President Donald Trump among voters in Minnesota, Fox News polling reveals.",
                        "keywords": "",
                        "snippet": "A Democrat has won the presidential race in Minnesota every cycle since 1976 and Vice President Kamala Harris is favorably positioned to extend this streak in 2...",
                        "url": "https://www.foxnews.com/official-polls/fox-news-poll-harris-bests-trump-6-points-minnesota",
                        "image_url": "https://static.foxnews.com/foxnews.com/content/uploads/2024/07/c4ddc2b7-KAMALA-HARRIS.jpg",
                        "language": "en",
                        "published_at": "2024-07-26T22:00:08.000000Z",
                        "source": "foxnews.com",
                        "categories": [
                            "general",
                            "politics"
                        ],
                        "locale": "us"
                    },
                    {
                        "uuid": "a42012a7-03e4-4d90-80e3-287c061d2ded",
                        "title": "Fox News Poll: Harris, Trump tied in Pennsylvania",
                        "description": "Former President Donald Trump and Vice President Kamala Harris are in a close contest in Pennsylvania, according to new Fox News polling.",
                        "keywords": "",
                        "snippet": "The latest Fox News survey of Pennsylvania voters finds Vice President Kamala Harris in a dead heat with former President Donald Trump. This comes two weeks aft...",
                        "url": "https://www.foxnews.com/official-polls/fox-news-poll-harris-trump-dead-heat-pennsylvania",
                        "image_url": "https://static.foxnews.com/foxnews.com/content/uploads/2024/07/trump-kamala-harris-split.jpg",
                        "language": "en",
                        "published_at": "2024-07-26T22:00:10.000000Z",
                        "source": "foxnews.com",
                        "categories": [
                            "general",
                            "politics"
                        ],
                        "locale": "us"
                    },
                    {
                        "uuid": "3b663ac5-86a5-474c-8e2e-bc937c732a92",
                        "title": "Fox News Poll: Trump hits 50% in Wisconsin, edges Harris by just 1 point",
                        "description": "Former President Donald Trump is leading Vice President Harris in Wisconsin, just days after the Republican National Convention was held in Milwaukee.",
                        "keywords": "",
                        "snippet": "At this same point in the election cycle four years ago, Joe Biden was ahead of Donald Trump by 9 percentage points among Wisconsin voters in a two-way presiden...",
                        "url": "https://www.foxnews.com/official-polls/fox-news-poll-trump-hits-50-wisconsin-edges-harris-just-1-point",
                        "image_url": "https://static.foxnews.com/static/orion/styles/img/fox-news/og/og-fox-news.png",
                        "language": "en",
                        "published_at": "2024-07-26T22:00:12.000000Z",
                        "source": "foxnews.com",
                        "categories": [
                            "general",
                            "politics"
                        ],
                        "locale": "us"
                    }
                ]
            },
            {
                "uuid": "f8d3b922-83b0-4cd4-b977-29ee37461660",
                "title": "‘LeFraud’: Fans Blast LeBron James as U.S. Flag Bearer for 2024 Paris Olympics Opening Ceremony",
                "description": "The U.S. Olympics committee chose anthem protester Lebron James to carry the American flag in the opening ceremonies.",
                "keywords": "",
                "snippet": "The U.S. Olympics committee chose national anthem protester and chronic America basher Lebron James to carry the American flag in the opening ceremonies, making...",
                "url": "https://www.breitbart.com/sports/2024/07/26/lefraud-fans-blast-lebron-james-as-u-s-flag-bearer-for-2024-paris-olympics-opening-ceremony/",
                "image_url": "https://media.breitbart.com/media/2024/07/MAURO-PIMENTEL_AFP-via-Getty-Images-640x335.jpg",
                "language": "en",
                "published_at": "2024-07-26T21:57:27.000000Z",
                "source": "breitbart.com",
                "categories": [
                    "general",
                    "politics"
                ],
                "locale": "us",
                "similar": [
                    {
                        "uuid": "c6cc49f0-e571-4888-8b2a-1ec3acdbffe9",
                        "title": "Paris glitters in the rain for ambitious Olympic opening ceremony",
                        "description": "Paris has kicked off its first Summer Olympics in a century with a rain-soaked, rule-breaking opening ceremony.",
                        "keywords": "2024 Paris Olympic Games, Olympic games, General news, Photo Paris, Sports, a, World news, Celine Dion, World News",
                        "snippet": "Paris has kicked off its first Summer Olympics in a century with a rain-soaked, rule-breaking opening ceremony.\n\nWidespread travel disruptions triggered by what...",
                        "url": "https://apnews.com/article/olympics-2024-photos-paris-4703be2235b5daa766582bdbc0f45dae",
                        "image_url": "https://dims.apnews.com/dims4/default/0fbad88/2147483647/strip/true/crop/3746x2107+0+195/resize/1440x810!/quality/90/?url=https%3A%2F%2Fassets.apnews.com%2F%5B-%2F67%2F%2C%20-74%2C%20-104%2C%20-99%2C%20-75%2C%2069%2C%20113%2C%20-86%2C%20-31%2C%20-110%2C%2013%2C%20-113%2C%2023%2C%2059%2C%20107%2C%20-22%2C%20125%2C%20105%2C%20-120%2C%205%2C%20-76%2C%2084%2C%2072%2C%20106%2C%2024%2C%20-86%2C%2055%2C%2064%5D%2F731c8054ea3c41babee2145f16a99e2d",
                        "language": "en",
                        "published_at": "2024-07-26T23:53:01.000000Z",
                        "source": "apnews.com",
                        "categories": [
                            "general"
                        ],
                        "locale": "us"
                    },
                    {
                        "uuid": "08667ec8-883d-4c8e-95ea-376bd14bf5ea",
                        "title": "Olympics opening ceremony sparks outrage with drag queens parodying Last Supper: 'Gone completely woke'",
                        "description": "Commentators around the world expressed outrage over a drag-themed rendition of the famous Christian painting \"The Last Supper\" at the opening ceremonies for the 2024 Paris Olympics.",
                        "keywords": "",
                        "snippet": "The 2024 Olympics opening ceremony in Paris has sparked international outrage with drag-queen themed imagery of religious and historical figures.\n\nIn between li...",
                        "url": "https://www.foxnews.com/media/olympics-opening-ceremony-sparks-outrage-drag-queens-parodying-last-supper-gone-completely-woke",
                        "image_url": "https://static.foxnews.com/foxnews.com/content/uploads/2024/07/ceremony-performance.jpg",
                        "language": "en",
                        "published_at": "2024-07-26T23:37:20.000000Z",
                        "source": "foxnews.com",
                        "categories": [
                            "general",
                            "politics"
                        ],
                        "locale": "us"
                    },
                    {
                        "uuid": "46f78fd4-44fd-4a73-b276-3c25773e6043",
                        "title": "‘Degeneracy’: Barely Clothed, Bearded Drag Queen Dances Seductively at Paris’ Olympic Opening Ceremony",
                        "description": "The Tour de Farce that was the opening ceremony of the Paris Olympics included a scantily-clad, bearded drag queen doing a provocative dance.",
                        "keywords": "",
                        "snippet": "The Tour de Farce that was the opening ceremony of the Paris Olympics included a drag queen version of the Last Supper, a strongly suggested bisexual threesome,...",
                        "url": "https://www.breitbart.com/europe/2024/07/26/degeneracy-barely-clothed-bearded-drag-queen-dances-seductively-at-paris-olympic-opening-ceremony/",
                        "image_url": "https://media.breitbart.com/media/2024/07/FABRICE-COFFRINI_AFP-via-Getty-Images-640x335.jpg",
                        "language": "en",
                        "published_at": "2024-07-27T01:02:29.000000Z",
                        "source": "breitbart.com",
                        "categories": [
                            "general",
                            "politics"
                        ],
                        "locale": "us"
                    },
                    {
                        "uuid": "52f401a4-6575-462f-8fbd-d046f2fcb048",
                        "title": "Paris Olympics Opening Ceremony Recreates ‘Last Supper’ with Drag Queens & Trans Performers",
                        "description": "Further making the Olympics opening ceremonies the “gayest ever,” Parisian Olympics officials also featured an LGBTQ parody of the \"Last Supper\" along with a woke fashion show featuring gender-bending fashions and transgender models.",
                        "keywords": "",
                        "snippet": "Further making the Olympics opening ceremonies the “gayest ever,” Parisian Olympics officials also featured an LGBTQ parody of the “Last Supper” along w...",
                        "url": "https://www.breitbart.com/sports/2024/07/26/paris-olympics-opening-ceremony-recreates-last-supper-with-drag-queens-trans-performers/",
                        "image_url": "https://media.breitbart.com/media/2024/07/paris-olympics-opening-7-26-24-getty-640x335.png",
                        "language": "en",
                        "published_at": "2024-07-26T23:24:02.000000Z",
                        "source": "breitbart.com",
                        "categories": [
                            "general",
                            "politics"
                        ],
                        "locale": "us"
                    }
                ]
            }
        ],
        "business": ...,
        "sports": ...,
        "tech": ...,
        "science": ...,
        "health": ...
    }
}
            
        

Top Stories Available on: All plans

Endpoint

            
                GET https://api.thenewsapi.com/v1/news/top HTTP/1.1
            
        

Use this endpoint to find live and historical top stories around the world or filter to get only top stories for specific countries. Filtering by language, category, source and publish date is also possible, as well as advanced searching on title and the main text of the article.

If you have issues with your requests, please ensure your GET parameters are URL-encoded.

All text data returned is UTF-8.

All dates are in UTC (GMT).

HTTP GET Parameters

name required description
api_token true Your API token which can be found on your account dashboard.
search false Use the search as a basic search tool by entering regular search terms or it has more advanced usage to build search queries:
+ signifies AND operation
| signifies OR operation
- negates a single token
" wraps a number of tokens to signify a phrase for searching
* at the end of a term signifies a prefix query
( and ) signify precedence

To use one of these characters literally, escape it with a preceding backslash (\).

Example 1: forex + (usd | gbp) -cad (searches for forex articles which include usd or gbp but excludes cad)
Example 2: "Apple Inc" (searches for articles with exact matches for "Apple Inc")

For more advanced query examples, see our API Examples section.

When using special characters (+, -, |, ", *, ()) you MUST URL-encode this parameter.
search_fields false Comma separated list of fields to apply the search parameter to.
Supported fields: title | description | keywords | main_text
Example: title,description,keywords
Default: title,main_text
locale false Comma separated list of country codes to include in the result set. Default is all countries. Click here for a list of supported countries.
Example: us,ca (US + Canada).
categories false Comma separated list of categories to include.
Supported categories: general | science | sports | business | health | entertainment | tech | politics | food | travel
Example: business,tech
exclude_categories false Comma separated list of categories to exclude.
domains false Comma separated list of domains to include. List of domains can be obtained through our Sources endpoint, found further down this page.
exclude_domains false Comma separated list of domains to exclude
source_ids false Comma separated list of source_ids to include. List of source_ids can be obtained through our Sources endpoint, found further down this page.
exclude_source_ids false Comma separated list of source_ids to exclude.
language false Comma separated list of languages to include. Default is all.
Click here for a list of supported languages.
Examples: en,es (English + Spanish)
published_before false Find all articles published before the specified date. Supported formats include: Y-m-d\TH:i:s | Y-m-d\TH:i | Y-m-d\TH | Y-m-d | Y-m | Y.
Examples: 2024-07-27T09:46:53 | 2024-07-27T09:46 | 2024-07-27T09 | 2024-07-27 | 2024-07 | 2024
published_after false Find all articles published after the specified date. Supported formats include: Y-m-d\TH:i:s | Y-m-d\TH:i | Y-m-d\TH | Y-m-d | Y-m | Y.
Examples: 2024-07-27T09:46:53 | 2024-07-27T09:46 | 2024-07-27T09 | 2024-07-27 | 2024-07 | 2024
published_on false Find all articles published on the specified date. Supported formats include: Y-m-d.
Examples: 2024-07-27
sort false Sort by published_on or relevance_score (only available when used in conjunction with search). Default is published_at unless search is used and sorting by published_at is not included, in which case relevance_score is used.
limit false Specify the number of articles you want to return in the request. The maximum limit is based on your plan. The default limit is the maximum specified for your plan.
page false Use this to paginate through the result set. Default is 1. Note that the max result set can't exceed 20,000. For example if your limit is 50, the max page you can have is 400 (50 * 400 = 20,000).
Example: page=2

Response Objects

name description
meta > found The number of articles found for the request.
meta > returned The number of articles returned on the page. This is useful to determine the end of the result set as if this is lower than limit, there are no more articles after this page.
meta > limit The limit based on the limit parameter.
meta > page The page number based on the page parameter.
data > uuid The unique identifier for an article in our system. Store this and use it to find specific articles using our single article endpoint.
data > title The article title.
data > description The article meta description.
data > keywords The article meta keywords.
data > snippet The first 60 characters of the article body.
data > url The URL to the article.
data > image_url The URL to the article image.
data > language The language of the source.
data > published_at The datetime the article was published.
data > source The domain of the source.
data > categories Array of strings which the source is categorized as.
data > relevance_score Relevance score based on the search parameter. If the search parameter is not used, this will be null.
data > locale Locale of the source.

If no results are found, the data object will be empty.

Example Request

            
                GET https://api.thenewsapi.com/v1/news/top?api_token=YOUR_API_TOKEN&locale=us&limit=3
            
        

Example Response

            
                {
    "meta": {
        "found": 1068681,
        "returned": 10,
        "limit": 10,
        "page": 1
    },
    "data": [
        {
            "uuid": "09c5e915-be28-4265-be8d-0349c4a5a529",
            "title": "Rain overnight postpones first skateboarding event at Paris Olympics",
            "description": "Men’s street skateboarding scheduled for Saturday was postponed to Monday. The women’s event is scheduled for Sunday.",
            "keywords": "Skateboarding, 2024 Paris Olympic Games, Weather, Sports, Paris, Olympic games",
            "snippet": "The Associated Press is an independent global news organization dedicated to factual reporting. Founded in 1846, AP today remains the most trusted source of fas...",
            "url": "https://apnews.com/article/paris-olympics-skateboarding-postponed-9744fd50aca5991d11d657ba0e906855",
            "image_url": "https://dims.apnews.com/dims4/default/f1cdf16/2147483647/strip/true/crop/3624x2039+0+189/resize/1440x810!/quality/90/?url=https%3A%2F%2Fassets.apnews.com%2F%5B9%2F0%2C%2F%20-59%2C%2012%2C%20-87%2C%20-97%2C%20-45%2C%20106%2C%20-82%2C%2096%2C%20-19%2C%20-27%2C%20-71%2C%20-22%2C%2058%2C%2060%2C%2037%2C%2049%2C%209%2C%20-117%2C%20-28%2C%2078%2C%20-75%2C%2094%2C%20-39%2C%20-40%2C%2020%2C%20-39%2C%20126%5D%2Fbed87f8b690248c2bae12245a8b35d8c",
            "language": "en",
            "published_at": "2024-07-27T09:23:02.000000Z",
            "source": "apnews.com",
            "categories": [
                "general"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "947c9974-0955-4f28-ac0c-c2becf944a88",
            "title": "Liberal outlets, Democrats run defense for VP Harris as she continues to solidify nomination support",
            "description": "Media outlets defended Vice President Harris over her work on the border crisis, her prior support for a controversial bail fund and her title as the “most li...",
            "keywords": "",
            "snippet": "Media outlets, Democratic lawmakers and White House officials defended Vice President Harris this week over her work on the border crisis, her previous support ...",
            "url": "https://www.foxnews.com/media/liberal-outlets-run-defense-vp-harris-continues-solidify-nomination-support",
            "image_url": "https://static.foxnews.com/foxnews.com/content/uploads/2024/07/Joe-Biden-Kamala-Harris-2024-Election_09.jpg",
            "language": "en",
            "published_at": "2024-07-27T09:00:59.000000Z",
            "source": "foxnews.com",
            "categories": [
                "general",
                "politics"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "9c751a07-b002-48fe-b93c-564d9b4484ed",
            "title": "Trump assassination attempt in Butler, Pennsylvania, has chilling ties to George Washington, first president",
            "description": "Butler, Pennsylvania, the site of the recent assassination attempt on former President Donald Trump, was just six miles away from a similar attempt on President...",
            "keywords": "",
            "snippet": "An important figure in American history once narrowly escaped with his life after an assassination attempt in western Pennsylvania – but it wasn't former Pres...",
            "url": "https://www.foxnews.com/lifestyle/trump-assassination-attempt-butler-pennsylvania-chilling-tie-george-washington-first-president",
            "image_url": "https://static.foxnews.com/foxnews.com/content/uploads/2024/07/Trump-washington-attempts-split.jpg",
            "language": "en",
            "published_at": "2024-07-27T09:00:39.000000Z",
            "source": "foxnews.com",
            "categories": [
                "general",
                "politics"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "247ea436-f92c-4ecb-8bbb-6bb7b14132a1",
            "title": "International airport abandoned for over 20 Years has been taken over by nature",
            "description": "The last plane departed from Hellinikon Airport in Greece on March 28 2001",
            "keywords": "Airport, Transport in Athens, the 2004 Olympics, Elliniko-Argyroupoli, Ellinikon International Airport, Vasilis Manjuranis, Quartz",
            "snippet": "When they’re up and running, airports are hubs of life and activity, with excited travelers heading out on holiday, reluctant businessman flying for work and ...",
            "url": "https://qz.com/international-airport-abandoned-for-over-20-years-has-b-1851606854",
            "image_url": "https://i.kinja-img.com/image/upload/c_fill,h_675,pg_1,q_80,w_1200/54f1d8a6109f73b063ee91839646fed7.png",
            "language": "en",
            "published_at": "2024-07-27T09:00:00.000000Z",
            "source": "qz.com",
            "categories": [
                "general",
                "business",
                "tech",
                "entertainment"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "ccfba9f3-4065-4fa0-9483-2aba1335507b",
            "title": "The Boys Are Not All Right",
            "description": "What the “Zynternet” tells us about sports betting, post-grad frat culture and their internet politics.",
            "keywords": "",
            "snippet": "If you can't access your feeds, please contact customer support.\n\nThanks! Check your phone for a link to finish setting up your feed.\n\nPlease enter a 10-digit p...",
            "url": "https://slate.com/podcasts/icymi/2024/07/zynternet-explained?via=rss",
            "image_url": "https://compote.slate.com/images/a48316c5-ca2e-4812-9eb8-841f1b870201.gif?crop=1560%2C1040%2Cx0%2Cy0&width=1560",
            "language": "en",
            "published_at": "2024-07-27T09:00:00.000000Z",
            "source": "slate.com",
            "categories": [
                "general"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "e854afa6-0ef4-468e-8ca4-7534d1f48f21",
            "title": "Business: Rupert Murdoch moves to push out his liberal children from his conservative news dynasty.",
            "description": "The patriarch wants one conservative son to take over. The rest of his brood are not thrilled.",
            "keywords": "",
            "snippet": "If you can't access your feeds, please contact customer support.\n\nThanks! Check your phone for a link to finish setting up your feed.\n\nPlease enter a 10-digit p...",
            "url": "https://slate.com/podcasts/slate-money/2024/07/business-rupert-murdoch-conservative-news-fox-news-southwest-airlines-stocks?via=rss",
            "image_url": "https://compote.slate.com/images/0ad4cce0-1643-405e-b092-a65cc2f24b9e.jpeg?crop=1560%2C1040%2Cx0%2Cy0&width=1560",
            "language": "en",
            "published_at": "2024-07-27T09:00:00.000000Z",
            "source": "slate.com",
            "categories": [
                "general"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "23c076e9-c946-47a3-ae13-8043cd96641c",
            "title": "SCOTUS Needs Change: Judge David S. Tatel explains why.",
            "description": "Judge David S. Tatel explains how SCOTUS went astray, and the lessons he learned during his time on the bench.",
            "keywords": "",
            "snippet": "It’s not just us feeling exhausted right? It’s been a totally wild past few weeks. That’s why we are taking off the next few weeks to bring you a special ...",
            "url": "https://slate.com/podcasts/amicus/2024/07/scotus-needs-change-judge-david-s-tatel-explains-why?via=rss",
            "image_url": "https://compote.slate.com/images/24c63d16-8900-46e1-a529-a8c4f6aeab2d.png?crop=1080%2C720%2Cx100%2Cy0&width=1560",
            "language": "en",
            "published_at": "2024-07-27T09:00:00.000000Z",
            "source": "slate.com",
            "categories": [
                "general"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "524feb64-4be2-48b5-b808-fdaee7c8e556",
            "title": "Céline Dion Shares Emotional Message After Comeback Triumph; Justin Trudeau Hails “Canadian Icon”",
            "description": "Justin Trudeau hailed the superstar after her health battle, calling Dion a \"Canadian Icon.\"",
            "keywords": "",
            "snippet": "Celine Dion has shared a message with her fans, following her triumphant comeback performance at the close of the Paris Olympics Opening Ceremony.\n\nThe French-C...",
            "url": "https://deadline.com/2024/07/celine-dion-emotional-message-after-olympics-comeback-triumph-justin-trudeau-hails-canadian-icon-1236024512/",
            "image_url": "https://deadline.com/wp-content/uploads/2024/07/GettyImages-2162967063_be578e.jpg?w=1024",
            "language": "en",
            "published_at": "2024-07-27T08:59:59.000000Z",
            "source": "deadline.com",
            "categories": [
                "entertainment"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "9335e6f9-c797-467f-916f-2ca40029cdb1",
            "title": "East African nation bans Ethiopian Airlines flights",
            "description": "Eritrean authorities have suspended Ethiopian Airlines flights starting from September 30",
            "keywords": "",
            "snippet": "The Eritrean Civil Aviation Authority has halted all routes of the neighboring country’s flagship carrier\n\nEthiopian Airlines announced on Wednesday that Erit...",
            "url": "https://www.rt.com/africa/601680-eritrea-stops-ethiopian-airlines-flights/",
            "image_url": "https://mf.b37mrtl.ru/files/2024.07/article/66a36c8e20302776471cb21c.jpg",
            "language": "en",
            "published_at": "2024-07-27T08:32:58.000000Z",
            "source": "rt.com",
            "categories": [
                "general",
                "politics"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "a7bd0fc9-5392-435a-916d-47d981251285",
            "title": "Mobilization not under discussion – Kremlin",
            "description": "“No one is talking” about an additional mobilization effort in Russia, Kremlin spokesman Dmitry Peskov has said",
            "keywords": "",
            "snippet": "Moscow has repeatedly said the military enjoys a steady stream of volunteers\n\nRussian authorities are not even remotely considering a new wave of mobilization i...",
            "url": "https://www.rt.com/russia/601730-mobilization-russia-no-discussion-kremlin/",
            "image_url": "https://mf.b37mrtl.ru/files/2024.07/article/66a4a82c85f5401c0569b2d7.jpg",
            "language": "en",
            "published_at": "2024-07-27T08:06:34.000000Z",
            "source": "rt.com",
            "categories": [
                "general",
                "politics"
            ],
            "relevance_score": null,
            "locale": "us"
        }
    ]
}
            
        

All News Available on: All plans

Endpoint

            
                GET https://api.thenewsapi.com/v1/news/all HTTP/1.1
            
        

Use this endpoint to find all live and historical articles we collect. Filtering by language, category, source and publish date is also possible, as well as advanced searching on title and the main text of the article.

If you have issues with your requests, please ensure your GET parameters are URL-encoded.

All text data returned is UTF-8.

All dates are in UTC (GMT).

HTTP GET Parameters

name required description
api_token true Your API token which can be found on your account dashboard.
search false Use the search as a basic search tool by entering regular search terms or it has more advanced usage to build search queries:
+ signifies AND operation
| signifies OR operation
- negates a single token
" wraps a number of tokens to signify a phrase for searching
* at the end of a term signifies a prefix query
( and ) signify precedence

To use one of these characters literally, escape it with a preceding backslash (\).

Example 1: forex + (usd | gbp) -cad (searches for forex articles which include usd or gbp but excludes cad)
Example 2: "Apple Inc" (searches for articles with exact matches for "Apple Inc")

For more advanced query examples, see our API Examples section.

When using special characters (+, -, |, ", *, ()) you MUST URL-encode this parameter.
search_fields false Comma separated list of fields to apply the search parameter to.
Supported fields: title | description | keywords | main_text
Example: title,description,keywords
Default: title,main_text
categories false Comma separated list of categories to include.
Supported categories: general | science | sports | business | health | entertainment | tech | politics | food | travel
Example: business,tech
exclude_categories false Comma separated list of categories to exclude.
domains false Comma separated list of domains to include. List of domains can be obtained through our Sources endpoint, found further down this page.
exclude_domains false Comma separated list of domains to exclude
source_ids false Comma separated list of source_ids to include. List of source_ids can be obtained through our Sources endpoint, found further down this page.
exclude_source_ids false Comma separated list of source_ids to exclude.
language false Comma separated list of languages to include. Default is all.
Click here for a list of supported languages.
Examples: en,es (English + Spanish)
published_before false Find all articles published before the specified date. Supported formats include: Y-m-d\TH:i:s | Y-m-d\TH:i | Y-m-d\TH | Y-m-d | Y-m | Y.
Examples: 2024-07-27T09:46:53 | 2024-07-27T09:46 | 2024-07-27T09 | 2024-07-27 | 2024-07 | 2024
published_after false Find all articles published after the specified date. Supported formats include: Y-m-d\TH:i:s | Y-m-d\TH:i | Y-m-d\TH | Y-m-d | Y-m | Y.
Examples: 2024-07-27T09:46:53 | 2024-07-27T09:46 | 2024-07-27T09 | 2024-07-27 | 2024-07 | 2024
published_on false Find all articles published on the specified date. Supported formats include: Y-m-d.
Examples: 2024-07-27
sort false Sort by published_on or relevance_score (only available when used in conjunction with search). Default is published_at unless search is used and sorting by published_at is not included, in which case relevance_score is used.
limit false Specify the number of articles you want to return in the request. The maximum limit is based on your plan. The default limit is the maximum specified for your plan.
page false Use this to paginate through the result set. Default is 1. Note that the max result set can't exceed 20,000. For example if your limit is 50, the max page you can have is 400 (50 * 400 = 20,000).
Example: page=2

Response Objects

name description
meta > found The number of articles found for the request.
meta > returned The number of articles returned on the page. This is useful to determine the end of the result set as if this is lower than limit, there are no more articles after this page.
meta > limit The limit based on the limit parameter.
meta > page The page number based on the page parameter.
data > uuid The unique identifier for an article in our system. Store this and use it to find specific articles using our single article endpoint.
data > title The article title.
data > description The article meta description.
data > keywords The article meta keywords.
data > snippet The first 60 characters of the article body.
data > url The URL to the article.
data > image_url The URL to the article image.
data > language The language of the source.
data > published_at The datetime the article was published.
data > source The domain of the source.
data > categories Array of strings which the source is categorized as.
data > relevance_score Relevance score based on the search parameter. If the search parameter is not used, this will be null.

If no results are found, the data object will be empty.

Example Request

            
                GET https://api.thenewsapi.com/v1/news/all?api_token=YOUR_API_TOKEN&language=en&limit=3
            
        

Example Response

            
                {
    "meta": {
        "found": 49439104,
        "returned": 10,
        "limit": 10,
        "page": 1
    },
    "data": [
        {
            "uuid": "1b3b7837-daba-4816-842b-836d6b5c3f25",
            "title": "Fiorentina, si cercano rinforzi a centrocampo: nel mirino McKennie e non solo",
            "description": "Dopo l'arrivo di Colpani, la Fiorentina va a caccia di altri elementi a centrocampo",
            "keywords": "Serie A, fanta, Fantacalcio, Calcio",
            "snippet": "Dopo l'arrivo di Colpani, la Fiorentina va a caccia di altri elementi a centrocampo. Diversi sono i profili sondati dal club viola, sulle tracce di nuovi rinfor...",
            "url": "https://www.fantacalcio.it/calciomercato/27_07_2024/fiorentina-cercano-rinforzi-centrocampo-mirino-mckennie-463891",
            "image_url": "https://content.fantacalcio.it/web/img/large/McKennie-b729ec33-499c-40c9-802c-eb4e64dfd444.jpg",
            "language": "it",
            "published_at": "2024-07-27T09:46:25.000000Z",
            "source": "fantacalcio.it",
            "categories": [
                "sports"
            ],
            "relevance_score": null
        },
        {
            "uuid": "a8d87e44-c2c0-437c-a480-5cc72e006692",
            "title": "“누구나 어떤 면에서는 소수자일 수 있다”",
            "description": "개봉한지 20여 년 가까이 흘렀지만 여전히 성 소수자 영화의 대표작처럼 손꼽히는 이안 감독의 ‘브로크백 마운틴’(2005)...",
            "keywords": "성 소수자, 브로크백 마운틴, 콜 미 바이 유어 네임, 히스 레저, 미셸 윌리엄스, 제이크 질렌할, 아미 헤머, 티모시 샬라메, 동성결혼, 동성결혼 허용, 문라이트, 대법원",
            "snippet": "▲ 영화 ‘브로크백 마운틴’ 스틸컷\n\n개봉한지 20여 년 가까이 흘렀지만 여전히 성 소수자 영화의 대표작처럼 손꼽히는 ...",
            "url": "https://www.mediatoday.co.kr/news/articleView.html?idxno=319669",
            "image_url": "https://cdn.mediatoday.co.kr/news/thumbnail/202407/319669_450600_4118_v150.jpg",
            "language": "ko",
            "published_at": "2024-07-27T09:46:19.000000Z",
            "source": "mediatoday.co.kr",
            "categories": [
                "general"
            ],
            "relevance_score": null
        },
        {
            "uuid": "be740fda-d2a7-4681-aef5-662196b6c087",
            "title": "科?",
            "description": "",
            "keywords": "",
            "snippet": "",
            "url": "https://blog.sciencenet.cn/home.php?mod=space&uid=415&do=blog&id=1444008",
            "image_url": "",
            "language": "zh",
            "published_at": "2024-07-27T09:46:10.000000Z",
            "source": "blog.sciencenet.cn",
            "categories": [
                "science"
            ],
            "relevance_score": null
        },
        {
            "uuid": "19752443-23c1-4ae4-a20a-fbe1852bc3cc",
            "title": "Открытие Олимпиады в Париже: парад лодок по Сене, ливень, Зидан и Селин Дион",
            "description": "Итак, в Париже открылись ХХХIII Олимпийские игры.",
            "keywords": "",
            "snippet": "Впервые церемония проводилась не на стадионе, а в самом центре города. Олимпийские кома...",
            "url": "https://www.niknews.mk.ua/2024/07/27/otkrytie-olimpiady-v-parizhe-parad-lodok-po-sene-liven-zidan-i-selin-dion/",
            "image_url": "https://www.niknews.mk.ua/image/94/93559-600x0.jpg",
            "language": "ru",
            "published_at": "2024-07-27T09:46:00.000000Z",
            "source": "niknews.mk.ua",
            "categories": [],
            "relevance_score": null
        },
        {
            "uuid": "5863966c-cb26-4a8d-a8f2-bbf9922e598a",
            "title": "노잼도시 탈출하지 맙시다",
            "description": "포털 사이트에서 ‘노잼 도시’라고 검색해봤다. ① [노잼 도시 탈출기] 특급호텔 유치 절실② [노잼도시 울산 탈피] 관?...",
            "keywords": "노잼, 노잼도시, 밈, 지역신문, 지방도시, 노잼 탈출, 관광, 관광 개발, 지자체, 지역 언론, 지방 도시, 지역민, 관광 시설, 지역 관광, 지방도시 관광",
            "snippet": "▲ 관광, 여행. 사진=gettyimagesbank\n\n포털 사이트에서 ‘노잼 도시’라고 검색해봤다.\n\n① [노잼 도시 탈출기] 특급호텔 유치...",
            "url": "https://www.mediatoday.co.kr/news/articleView.html?idxno=319642",
            "image_url": "https://cdn.mediatoday.co.kr/news/thumbnail/202407/319642_450541_1553_v150.jpg",
            "language": "ko",
            "published_at": "2024-07-27T09:45:54.000000Z",
            "source": "mediatoday.co.kr",
            "categories": [
                "general"
            ],
            "relevance_score": null
        },
        {
            "uuid": "fd71e4ca-a809-4eef-8e74-510de542c431",
            "title": "Hansa Rostock-Lazio: quando si gioca, orario, dove vederla in tv e streaming",
            "description": "Scopri tutto sull'amichevole della squadra di Baroni: info e canali per seguirla in tempo reale o in differita. Le possibili scelte del tecnico biancoceleste",
            "keywords": "",
            "snippet": "Amichevole in Germania per la Lazio di Baroni in vista della prossima stagione. Avversario di giornata sarà l' Hansa Rostock . Tanti assenti per l'allenatore b...",
            "url": "https://www.corrieredellosport.it/news/calcio/serie-a/lazio/2024/07/27-130718723/hansa_rostock-lazio_quando_si_gioca_orario_dove_vederla_in_tv_e_streaming",
            "image_url": "https://cdn.corrieredellosport.it/images/2024/07/27/094720239-d139ceee-add7-43f6-acd5-a61abf4aeba4.jpg",
            "language": "it",
            "published_at": "2024-07-27T09:45:53.000000Z",
            "source": "corrieredellosport.it",
            "categories": [
                "sports"
            ],
            "relevance_score": null
        },
        {
            "uuid": "4c8ae89c-54fb-446c-8418-e31a1470967f",
            "title": "언론장악 카르텔 추적 언론사 협업 프로젝트 의미 있다",
            "description": "미디어오늘 5기 독자권익위위원회(독권위)가 지난 25일 서울 영등포구 미디어오늘 회의실에서 7차 회의를 열었다. 김봄빛...",
            "keywords": "미디어오늘, 독자권익위원회, 미디어비평",
            "snippet": "▲미디어오늘.\n\n미디어오늘 5기 독자권익위위원회(독권위)가 지난 25일 서울 영등포구 미디어오늘 회의실에서 7차 회의를...",
            "url": "https://www.mediatoday.co.kr/news/articleView.html?idxno=319757",
            "image_url": "https://cdn.mediatoday.co.kr/news/thumbnail/202407/319757_450805_1933_v150.jpg",
            "language": "ko",
            "published_at": "2024-07-27T09:45:04.000000Z",
            "source": "mediatoday.co.kr",
            "categories": [
                "general"
            ],
            "relevance_score": null
        },
        {
            "uuid": "1c749a96-0e48-4d96-ad22-ef0ed3b91536",
            "title": "科?",
            "description": "",
            "keywords": "",
            "snippet": "",
            "url": "https://blog.sciencenet.cn/home.php?mod=space&uid=415&do=blog&id=1444007",
            "image_url": "",
            "language": "zh",
            "published_at": "2024-07-27T09:44:56.000000Z",
            "source": "blog.sciencenet.cn",
            "categories": [
                "science"
            ],
            "relevance_score": null
        },
        {
            "uuid": "8833d91d-b173-4d57-b456-03577bd3b011",
            "title": "장미란 차관, '한국→북한 소개' 관련 바흐 IOC 위원장에 면담 요청",
            "description": "2024 파리 올림픽 개회식에서 한국 선수단을 북한으로 소개한 것과 관련 문화체육관광부가 유감을 표명했다.문체부는 27?...",
            "keywords": "위원장, 올림픽, 선수단, 문체부, 프랑스",
            "snippet": "▲ 2024파리올림픽 개회식이 사상 최초로 야외에서 열린 26일 오후(현지시간) 프랑스 파리 센강에서 한국선수단이 탄 배가...",
            "url": "http://www.kado.net/news/articleView.html?idxno=1257221",
            "image_url": "https://cdn.kado.net/news/thumbnail/202407/1257221_695701_4029_v150.jpg",
            "language": "ko",
            "published_at": "2024-07-27T09:41:23.000000Z",
            "source": "kado.net",
            "categories": [],
            "relevance_score": null
        },
        {
            "uuid": "2b07ff06-262d-4df5-b941-3d302c0856f6",
            "title": "골프공 맞은 골퍼 영구 실명… 과실치상 혐의 캐디 항소심서 집유로 감형",
            "description": "티샷 공에 맞은 골퍼가 실명한 일과 관련, 안전 매뉴얼을 지키지 않은 과실로 1심에서 실형을 받은 50대 캐디가 항소심에?...",
            "keywords": "골프공, 과실치상, 항소심서, 매뉴얼, 항소심",
            "snippet": "▲ 일러스트/한규빛\n\n티샷 공에 맞은 골퍼가 실명한 일과 관련, 안전 매뉴얼을 지키지 않은 과실로 1심에서 실형을 받은 5...",
            "url": "http://www.kado.net/news/articleView.html?idxno=1257220",
            "image_url": "https://cdn.kado.net/news/thumbnail/202407/1257220_695700_4027_v150.jpg",
            "language": "ko",
            "published_at": "2024-07-27T09:41:03.000000Z",
            "source": "kado.net",
            "categories": [],
            "relevance_score": null
        }
    ]
}
            
        

Similar News Available on: All plans

Endpoint

            
                GET https://api.thenewsapi.com/v1/news/similar/uuid HTTP/1.1
            
        

Use this endpoint to find similar stories to a specific article based on its UUID.

If you have issues with your requests, please ensure your GET parameters are URL-encoded.

All text data returned is UTF-8.

All dates are in UTC (GMT).

HTTP GET Parameters

name required description
api_token true Your API token which can be found on your account dashboard.
categories false Comma separated list of categories to include.
Supported categories: general | science | sports | business | health | entertainment | tech | politics | food | travel
Example: business,tech
exclude_categories false Comma separated list of categories to exclude.
domains false Comma separated list of domains to include. List of domains can be obtained through our Sources endpoint, found further down this page.
exclude_domains false Comma separated list of domains to exclude
source_ids false Comma separated list of source_ids to include. List of source_ids can be obtained through our Sources endpoint, found further down this page.
exclude_source_ids false Comma separated list of source_ids to exclude.
language false Comma separated list of languages to include. Default is all.
Click here for a list of supported languages.
Examples: en,es (English + Spanish)
published_before false Find all articles published before the specified date. Supported formats include: Y-m-d\TH:i:s | Y-m-d\TH:i | Y-m-d\TH | Y-m-d | Y-m | Y.
Examples: 2024-07-27T09:46:53 | 2024-07-27T09:46 | 2024-07-27T09 | 2024-07-27 | 2024-07 | 2024
published_after false Find all articles published after the specified date. Supported formats include: Y-m-d\TH:i:s | Y-m-d\TH:i | Y-m-d\TH | Y-m-d | Y-m | Y.
Examples: 2024-07-27T09:46:53 | 2024-07-27T09:46 | 2024-07-27T09 | 2024-07-27 | 2024-07 | 2024
published_on false Find all articles published on the specified date. Supported formats include: Y-m-d.
Examples: 2024-07-27
limit false Specify the number of articles you want to return in the request. The maximum limit is based on your plan. The default limit is the maximum specified for your plan.
page false Use this to paginate through the result set. Default is 1. Note that the max result set can't exceed 20,000. For example if your limit is 50, the max page you can have is 400 (50 * 400 = 20,000).
Example: page=2

Response Objects

name description
meta > found The number of articles found for the request.
meta > returned The number of articles returned on the page. This is useful to determine the end of the result set as if this is lower than limit, there are no more articles after this page.
meta > limit The limit based on the limit parameter.
meta > page The page number based on the page parameter.
data > uuid The unique identifier for an article in our system. Store this and use it to find specific articles using our single article endpoint.
data > title The article title.
data > description The article meta description.
data > keywords The article meta keywords.
data > snippet The first 60 characters of the article body.
data > url The URL to the article.
data > image_url The URL to the article image.
data > language The language of the source.
data > published_at The datetime the article was published.
data > source The domain of the source.
data > categories Array of strings which the source is categorized as.
data > relevance_score Relevance score based on the article provided.

If no results are found, the data object will be empty.

Example Request

            
                GET https://api.thenewsapi.com/v1/news/similar/cc11e3ab-ced0-4a42-9146-e426505e2e67?api_token=YOUR_API_TOKEN&language=en&published_on=2020-12-01
            
        

Example Response

            
                
            {
               "meta": {
                  "found": 3571,
                  "returned": 3,
                  "limit": 3,
                  "page": 1
               },
               "data": [
                  {
                     "uuid": "df4ad427-a672-4c67-b6c6-6f81aa00e164",
                     "title": "Tesla stock jumps after announcement it will join S&P 500 in one go",
                     "description": "Tesla's stock price surged early Tuesday after the company b...",
                     "keywords": "Business, s&p 500, stocks, tesla",
                     "snippet": "Tesla’s stock price surged early Tuesday after the company...",
                     "url": "https://nypost.com/2020/12/01/tesla-stock-jumps-on-news-it-will-join-sp-500-in-one-shot/",
                     "image_url": "https://nypost.com/wp-content/uploads/sites/2/2020/12/tesla-52.jpg?quality=90&strip=all&w=1200",
                     "language": "en",
                     "published_at": "2020-12-01T14:35:46.000000Z",
                     "source": "nypost.com",
                     "categories": [
                        "business"
                     ],
                     "relevance_score": 153.61266
                  },
                  {
                     "uuid": "c9a23881-12dd-4005-8982-7b6552a2eb50",
                     "title": "Tesla To Join S&P 500 With Full Market Cap On December 21",
                     "description": "Tesla will be added to the S&P 500 index all at once at its ...",
                     "keywords": "Tesla, S&P500, EV, Automotive, Stocks, Investing",
                     "snippet": "Tesla (NASDAQ: TSLA) will be added to the S&P 500 index all ...",
                     "url": "https://oilprice.com/Latest-Energy-News/World-News/Tesla-To-Join-SP-500-With-Full-Market-Cap-On-December-21.html",
                     "image_url": "https://d32r1sh890xpii.cloudfront.net/news/718x300/2020-12-01_xwjdajwctl.jpg",
                     "language": "en",
                     "published_at": "2020-12-01T16:30:00.000000Z",
                     "source": "oilprice.com",
                     "categories": [
                        "general",
                        "business"
                     ],
                     "relevance_score": 146.92773
                  },
                  {
                     "uuid": "18afdb1c-7742-4016-bf8c-a2f114e11199",
                     "title": "Tesla to Enter S&P 500 at Full Weight in December",
                     "description": "The electric-vehicle maker will be added to the broad stock-...",
                     "keywords": "Motor Vehicles, Alternative Fuel Vehicles, Trusts Funds Financial Vehicles, Diversified Holding Companies, Automotive",
                     "snippet": "S&P Dow Jones Indices said it will add Tesla Inc.’s full w...",
                     "url": "https://www.wsj.com/articles/tesla-to-enter-s-p-500-at-full-weight-in-december-11606780897?mod=pls_whats_news_us_business_f",
                     "image_url": "https://images.wsj.net/im-265933/social",
                     "language": "en",
                     "published_at": "2020-12-01T00:01:00.000000Z",
                     "source": "online.wsj.com",
                     "categories": [
                        "business"
                     ],
                     "relevance_score": 128.22346
                  }
               ]
            }
        
            
        

News by UUID Available on: All plans

Endpoint

            
                GET https://api.thenewsapi.com/v1/news/uuid/uuid HTTP/1.1
            
        

Use this endpoint to find specific articles by the UUID which is returned on our search endpoints. This is useful if you wish to store the UUID to return the article later.

If you have issues with your requests, please ensure your GET parameters are URL-encoded.

All text data returned is UTF-8.

All dates are in UTC (GMT).

HTTP GET Parameters

name required description
api_token true Your API token which can be found on your account dashboard.

Response Objects

name description
uuid The unique identifier for an article in our system. Store this and use it to find specific articles using our single article endpoint.
title The article title.
description The article meta description.
keywords The article meta keywords.
snippet The first 60 characters of the article body.
url The URL to the article.
image_url The URL to the article image.
language The language of the source.
published_at The datetime the article was published.
source The domain of the source.
categories Array of strings which the source is categorized as.

If no results are found, a resource_not_found error will be returned.

Example Request

            
                GET https://api.thenewsapi.com/v1/news/uuid/147013d8-6c2c-4d50-8bad-eb3c8b7f5740?api_token=YOUR_API_TOKEN
            
        

Example Response

            
                
            {
                "uuid": "147013d8-6c2c-4d50-8bad-eb3c8b7f5740",
                "title": "These Are The Four American Companies Worth Over $1 Trillion Each – 24",
                "description": "America’s major market indexes set records in the early pa...",
                "keywords": "",
                "snippet": "These Are The Four American Companies Worth Over $1 Trillion...",
                "url": "https://247wallst.com/investing/2020/10/17/these-are-the-four-american-companies-worth-over-1-trillion-each/",
                "image_url": "https://247wallst.com/wp-content/uploads/2020/08/imageForEntry2-Qrj.jpg",
                "language": "en",
                "published_at": "2020-10-17T11:16:20.000000Z",
                "source": "247wallst.com",
                "categories": [
                    "business"
                ]
            }
        
            
        

Sources Available on: All plans

Endpoint

            
                GET https://api.thenewsapi.com/v1/news/sources HTTP/1.1
            
        

Use this endpoint to sources to use in your news API requests. Note that the limit is 50 for all requests.

If you have issues with your requests, please ensure your GET parameters are URL-encoded.

All text data returned is UTF-8.

HTTP GET Parameters

name required description
categories false Comma separated list of categories to include
Example: business,tech
exclude_categories false Comma separated list of categories to exclude
language false Comma separated list of languages to include. Default is all.
Click here for a list of supported languages.
Examples: en,es (English + Spanish)
page false Use this to paginate through the result set. Default is 1.
Example: page=2

Response Objects

name description
meta > found The number of sources found for the request.
meta > returned The number of sources returned on the page.
meta > limit The limit is 50. This currently can not be changed.
meta > page The page number based on the page parameter.
data > source_id The unique ID of the source feed. Use this for the source_ids or exclude_source_ids parameters in the news endpoints. There may be many source_ids for each domain, therefore we would generally suggest using the domains filter instead the source_ids filter.
data > domain The domain of the source. You can use this for the domains or exclude_domains parameters in the news endpoints.
data > language The source language.
data > locale The source locale. Note that only select sources have locales.
data > categories Array of strings which the source is categorized as.

If no results are found, the data object will be empty.

Example Request

            
                GET https://api.thenewsapi.com/v1/news/sources?api_token=YOUR_API_TOKEN&language=en
            
        

Example Response

            
                
            {
                "meta": {
                    "found": 15453,
                    "returned": 50,
                    "limit": 50,
                    "page": 1
                },
                "data": [
                    {
                        "source_id": "arstechnica.com-1",
                        "domain": "arstechnica.com",
                        "language": "en",
                        "locale": null,
                        "categories": [
                            "tech"
                        ]
                    },
                    {
                        "source_id": "adweek.com-1",
                        "domain": "adweek.com",
                        "language": "en",
                        "locale": null,
                        "categories": [
                            "business"
                        ]
                    },
                    ...
        
            
        

Errors

Errors

If your request was unsuccessful, you will receive a JSON formatted error. Below you will find the potential errors you may encounter when using the API.

Errors

error code HTTP status description
malformed_parameters 400 Validation of parameters failed. The failed parameters are usually shown in the error message.
invalid_api_token 401 Invalid API token.
usage_limit_reached 402 Usage limit of your plan has been reached. Usage limit and remaining requests can be found on the X-UsageLimit-Limit header.
endpoint_access_restricted 403 Access to the endpoint is not available on your current subscription plan.
resource_not_found 404 Resource could not be found.
invalid_api_endpoint 404 API route does not exist.
rate_limit_reached 429 Too many requests in the past 60 seconds. Rate limit and remaining requests can be found on the X-RateLimit-Limit header.
server_error 500 A server error occured.
maintenance_mode 503 The service is currently under maintenance.

Example Error Response

            
                
            {
                "error": {
                    "code": "malformed_parameters",
                    "message": "The published_before parameter(s) are incorrectly formatted."
                }
            }
        
            
        

Examples

API Examples

Our endpoints are very useful for filtering to find only specific resources you need. Follow each example request below to see how you can build dynamic queries.

Example Request 1

This is a basic request which will return all articles which match the search term "usd" within the title or body of the article:

    
        GET https://api.thenewsapi.com/v1/news/all?api_token=YOUR_API_TOKEN&search=usd
    

Example Request 2

This will return all articles which match the search term "usd" OR "gbp":

    
        GET https://api.thenewsapi.com/v1/news/all?api_token=YOUR_API_TOKEN&search=usd%20%7C%20gbp
    

Example Request 3

This will return all articles which match the search term "usd" AND "gbp":

    
        GET https://api.thenewsapi.com/v1/news/all?api_token=YOUR_API_TOKEN&search=usd%20%2B%20gbp
    

Example Request 4

This will return all articles which match the search term "usd" AND "gbp" but removes any articles which mentions "cad":

    
        GET https://api.thenewsapi.com/v1/news/all?api_token=YOUR_API_TOKEN&search=usd%20%2B%20gbp%20-cad
    

Example Request 5

This will return all articles which match the search term "forex" AND "usd" OR "gbp" but removes any articles which mentions "cad":

    
        GET https://api.thenewsapi.com/v1/news/all?api_token=YOUR_API_TOKEN&search=forex%20%2B%20%28usd%20%7C%20gbp%29%20-cad
    

Example Request 6

This is the same as Example Request 5 but will also ensure the articles returned are in English and categorized by business or tech but not travel, and are published within the last week:

    
        GET https://api.thenewsapi.com/v1/news/all?api_token=YOUR_API_TOKEN&search=forex%20%2B%20%28usd%20%7C%20gbp%29%20-cad&language=en&categories=business%2Ctech&exclude_categories=travel&published_after=2024-07-20
    

Code Examples

See our prepared examples below to quickly get started implementing our API into your next project.

PHP

    
        $queryString = http_build_query([
            'api_token' => 'YOUR_API_TOKEN',
            'categories' => 'business,tech',
            'search' => 'apple',
            'limit' => 50,
        ]);

        $ch = curl_init(sprintf('%s?%s', 'https://api.thenewsapi.com/v1/news/all', $queryString));
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

        $json = curl_exec($ch);

        curl_close($ch);

        $apiResult = json_decode($json, true);

        print_r($apiResult);
    

Python

    
        # Python 3
        import http.client, urllib.parse

        conn = http.client.HTTPSConnection('api.thenewsapi.com')

        params = urllib.parse.urlencode({
            'api_token': 'YOUR_API_TOKEN',
            'categories': 'business,tech',
            'limit': 50,
            })

        conn.request('GET', '/v1/news/all?{}'.format(params))

        res = conn.getresponse()
        data = res.read()

        print(data.decode('utf-8'))
    

Go

    
        package main

        import (
            "fmt"
            "io/ioutil"
            "net/http"
            "net/url"
        )

        func main() {
            baseURL, _ := url.Parse("https://thenewsapi.com")

            baseURL.Path += "v1/news/all"

            params := url.Values{}
            params.Add("api_token", "YOUR_API_TOKEN")
            params.Add("categories", "business,tech")
            params.Add("search", "apple")
            params.Add("limit", "50")

            baseURL.RawQuery = params.Encode()

            req, _ := http.NewRequest("GET", baseURL.String(), nil)

            res, _ := http.DefaultClient.Do(req)

            defer res.Body.Close()

            body, _ := ioutil.ReadAll(res.Body)

            fmt.Println(string(body))
        }
    

JavaScript

    
        var requestOptions = {
            method: 'GET'
        };

        var params = {
            api_token: 'YOUR_API_TOKEN',
            categories: 'business,tech',
            search: 'apple',
            limit: '50'
        };

        var esc = encodeURIComponent;
        var query = Object.keys(params)
            .map(function(k) {return esc(k) + '=' + esc(params[k]);})
            .join('&');

        fetch("https://api.thenewsapi.com/v1/news/all?" + query, requestOptions)
          .then(response => response.text())
          .then(result => console.log(result))
          .catch(error => console.log('error', error));
    

C#

    
        var client = new RestClient("https://api.thenewsapi.com/v1/news/all");
        client.Timeout = -1;

        var request = new RestRequest(Method.GET);

        request.AddQueryParameter("api_token", "YOUR_API_TOKEN");
        request.AddQueryParameter("categories", "business,tech");
        request.AddQueryParameter("search", "apple");
        request.AddQueryParameter("limit", "50");

        IRestResponse response = client.Execute(request);
        Console.WriteLine(response.Content);
    

Java

    
        OkHttpClient client = new OkHttpClient().newBuilder()
          .build();

        HttpUrl.Builder httpBuilder = HttpUrl.parse("https://api.thenewsapi.com/v1/news/all").newBuilder();
        httpBuilder.addQueryParameter("api_token", "YOUR_API_TOKEN");
        httpBuilder.addQueryParameter("categories", "business,tech");
        httpBuilder.addQueryParameter("search", "apple");
        httpBuilder.addQueryParameter("limit", "50");

        Request request = new Request.Builder().url(httpBuilder.build()).build();

        Response response = client.newCall(request).execute();