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!

If you require full article content or to extract article data from live links, check out articlextractor API .

To perform analysis on any text from our API, check out NLP-API.com for powerful Natural Language Processing tools.

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: 2023-03-29
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": "99b12a55-7362-46db-ac1b-53dac2039a9c",
                "title": "What US weapons tell us about the Russia-Ukraine war",
                "description": "The debate around which weapons to send to Ukraine, explained.",
                "keywords": "",
                "snippet": "In January, all of Washington seemed rapt with the question of whether the US and Europe would send tanks to Ukraine.\n\nShould they? Would they? Why weren’t th...",
                "url": "https://www.vox.com/world-politics/2023/3/29/23652435/debate-weapons-ukraine-abrams-leopard-tanks-biden-zelenskyy",
                "image_url": "https://cdn.vox-cdn.com/thumbor/XybvYZLpeAhmZKfvzNizmqo4YAI=/0x191:4000x2285/fit-in/1200x630/cdn.vox-cdn.com/uploads/chorus_asset/file/24532093/1248136564.jpg",
                "language": "en",
                "published_at": "2023-03-29T10:33:16.000000Z",
                "source": "vox.com",
                "categories": [
                    "general",
                    "politics",
                    "entertainment"
                ],
                "locale": "us",
                "similar": [
                    {
                        "uuid": "7b837c32-2718-44e3-8a04-4f755e32b238",
                        "title": "Zelensky: Ukraine must hold Bahkmut or Russia will ‘smell that we are weak’",
                        "description": "President Volodymyr Zelensky raised the stakes in the battle over Bahkmut, warning that if Russia conquers the eastern Ukrainian city, Moscow could begin amassing international support for a deal that would be undesirable for Ukraine.",
                        "keywords": "News, russia, ukraine war, vladimir putin, Volodymyr Zelensky, xi jinping",
                        "snippet": "Ukrainian President Volodymyr Zelensky has raised the stakes in the battle over Bahkmut, warning that if Russia conquers the eastern city, Moscow could begin bu...",
                        "url": "https://nypost.com/2023/03/29/zelensky-says-if-bahkmut-falls-russia-will-smell-that-we-are-weak/",
                        "image_url": "https://nypost.com/wp-content/uploads/sites/2/2023/03/NYPICHPDPICT000008934520.jpg?quality=75&strip=all&w=1024",
                        "language": "en",
                        "published_at": "2023-03-29T13:46:17.000000Z",
                        "source": "nypost.com",
                        "categories": [
                            "general"
                        ],
                        "locale": "us"
                    },
                    {
                        "uuid": "27d81adf-3688-45f3-a05e-7ff30ef76691",
                        "title": "Russia and West face long-term 'fight' – Kremlin",
                        "description": "Moscow needs to be confident in itself for a long-term “fight” against the West, says Kremlin spokesperson Dmitry Peskov",
                        "keywords": "",
                        "snippet": "A hybrid war is being waged against Moscow and it has to be confident in itself, says Kremlin spokesperson Dmitry Peskov\n\nRussia needs to remain firm and be con...",
                        "url": "https://www.rt.com/russia/573803-russia-west-long-fight/",
                        "image_url": "https://mf.b37mrtl.ru/files/2023.03/article/642445cc20302724ee57f37e.jpg",
                        "language": "en",
                        "published_at": "2023-03-29T14:08:13.000000Z",
                        "source": "rt.com",
                        "categories": [
                            "general",
                            "politics"
                        ],
                        "locale": "us"
                    },
                    {
                        "uuid": "971d128e-df20-4a09-afd7-640c98b09133",
                        "title": "Western Tanks Roll Into Ukraine",
                        "description": "Western tanks are now arriving in Ukraine in larger numbers, including consignments of British Challenger 2 and German Leopard 2 MBTs.",
                        "keywords": "",
                        "snippet": "Western tanks are now arriving in Ukraine in larger numbers, including consignments of British Challenger 2 and German Leopard 2 Main Battle Tanks this week, do...",
                        "url": "https://www.breitbart.com/europe/2023/03/29/marvellous-western-tanks-roll-into-ukraine/",
                        "image_url": "https://media.breitbart.com/media/2023/03/challenger-tanks-ukraine-e1680022740936-640x335.png",
                        "language": "en",
                        "published_at": "2023-03-29T11:15:09.000000Z",
                        "source": "breitbart.com",
                        "categories": [
                            "general",
                            "politics"
                        ],
                        "locale": "us"
                    },
                    {
                        "uuid": "6fa1aa5b-e011-43a0-82e5-8015d320cf4b",
                        "title": "Mark Hamill Plays Luke Skywalker to Deliver Ukraine Air Raid Warnings",
                        "description": "Actor Mark Hamill has joined an increasingly long line of Hollywood stars seeking to insert themselves into the Ukraine conflict.",
                        "keywords": "",
                        "snippet": "Actor Mark Hamill has joined an increasingly long line of Hollywood stars seeking to insert themselves into the Ukraine conflict with his voice, mustering a Jed...",
                        "url": "https://www.breitbart.com/entertainment/2023/03/29/mark-hamill-plays-luke-skywalker-to-deliver-ukraine-air-raid-warnings/",
                        "image_url": "https://media.breitbart.com/media/2018/11/MarkHamillwomen1.jpg",
                        "language": "en",
                        "published_at": "2023-03-29T13:45:54.000000Z",
                        "source": "breitbart.com",
                        "categories": [
                            "general",
                            "politics"
                        ],
                        "locale": "us"
                    },
                    {
                        "uuid": "21ef003a-f6d3-4bd8-a7e7-f40ca93fe770",
                        "title": "Russia Has Suffered 220,000 Casualties in Ukraine So Far, Says UK",
                        "description": "Russia's casualties including dead and wounded in Ukraine is on the road to hitting a quarter-million people, the United Kingdom says.",
                        "keywords": "",
                        "snippet": "Russia’s casualties including dead and wounded in what they euphemistically call their “special military operation” in Ukraine is on the road to hitting a...",
                        "url": "https://www.breitbart.com/europe/2023/03/29/russia-has-suffered-220000-casualties-in-ukraine-so-far-says-uk/",
                        "image_url": "https://media.breitbart.com/media/2023/03/GettyImages-1248214693-e1680099899581-640x335.jpg",
                        "language": "en",
                        "published_at": "2023-03-29T14:37:18.000000Z",
                        "source": "breitbart.com",
                        "categories": [
                            "general",
                            "politics"
                        ],
                        "locale": "us"
                    }
                ]
            },
            {
                "uuid": "4fa582e0-a1bf-4692-a0bb-9348a0705696",
                "title": "Taiwan’s Former President Makes Historic China Visit",
                "description": "Meanwhile, the United States is trying to downplay the current Taiwanese president's stopover visit.",
                "keywords": "",
                "snippet": "Welcome to today’s Morning Brief.\n\nStarting April 3, we’re launching FP World Brief, a daily newsletter that will replace Morning Brief. It will run Monday ...",
                "url": "https://foreignpolicy.com/2023/03/29/taiwan-former-president-china-north-korea-nukes/",
                "image_url": "https://foreignpolicy.com/wp-content/uploads/2023/03/GettyImages-1249570695-1.jpg?w=1000",
                "language": "en",
                "published_at": "2023-03-29T10:00:33.000000Z",
                "source": "foreignpolicy.com",
                "categories": [
                    "general",
                    "politics"
                ],
                "locale": "us",
                "similar": [
                    {
                        "uuid": "5af9383d-d538-47f6-b51e-18c80487b097",
                        "title": "China threatens retaliation if Tsai and McCarthy meet",
                        "description": "China has threatened “resolute countermeasures” over a planned meeting between Taiwan President Tsai Ing-wen and United States House Speaker Kevin McCarthy during an upcoming transit visit in Los Angeles by the head of the self-governing island democracy China claims as its own territory.",
                        "keywords": "Russia Ukraine war, Government policy, COVID-19 pandemic, Democracy, Politics, General news, Government and politics",
                        "snippet": "Tsai is scheduled to transit through New York on March 30 before heading to Guatemala and Belize. On April 5, she’s expected to stop in Los Angeles on her way...",
                        "url": "https://www.bostonglobe.com/2023/03/29/world/china-threatens-retaliation-if-tsai-mccarthy-meet/?camp=bg:brief:rss:feedly&rss_id=feedly_rss_brief",
                        "image_url": "https://bostonglobe-prod.cdn.arcpublishing.com/resizer/4ETBNL8brMggqHMmk0--EHXFk4g=/506x0/cloudfront-us-east-1.images.arcpublishing.com/bostonglobe/32AWNNJXMTR77CRI3GHFZJRVZY.jpg",
                        "language": "en",
                        "published_at": "2023-03-29T05:23:33.000000Z",
                        "source": "bostonglobe.com",
                        "categories": [
                            "general"
                        ],
                        "locale": "us"
                    },
                    {
                        "uuid": "e020aefb-5992-4492-9303-5794d88819ca",
                        "title": "China threatens retaliation if Tsai and McCarthy meet",
                        "description": "BEIJING (AP) — China has threatened “resolute countermeasures” over a planned meeting between Taiwanese President Tsai Ing-wen and Speaker of the United States House Speaker Kevin McCarthy during an upcoming visit in Los Angeles by the head of the self-governing island democracy.",
                        "keywords": "Taiwan, Politics, United States government, Taiwan government, China, Beijing, China government, Tsai Ing-wen, World News, United States",
                        "snippet": "In this image made from video, Taiwan's Presidential office secretary general Lin Chia-lung, left, President Tsai Ing-wen, center, and Foreign Minister Joseph W...",
                        "url": "https://apnews.com/article/china-reaction-tsai-mccarthy-meeting-taiwan-e1926816ce20590b2c7992fae8f8cd04",
                        "image_url": "https://storage.googleapis.com/afs-prod/media/3d2a7e3d5e5f4e6e9ed2ab8300837d7d/3000.jpeg",
                        "language": "en",
                        "published_at": "2023-03-29T05:53:05.000000Z",
                        "source": "apnews.com",
                        "categories": [
                            "general"
                        ],
                        "locale": "us"
                    },
                    {
                        "uuid": "451bce91-679b-459e-bbe1-3d1ff2159d2a",
                        "title": "China threatens retaliation if Tsai and McCarthy meet",
                        "description": "China has threatened “resolute countermeasures\" over a planned meeting between Taiwan President Tsai Ing-wen and United States House Speaker Kevin McCarthy during an upcoming transit visit in Los Angeles by the head of the self-governing island democra...",
                        "keywords": "Politics, Democracy, COVID-19 pandemic, Government policy, Russia Ukraine war, General news, Government and politics",
                        "snippet": "China has threatened “resolute countermeasures\" over a planned meeting between Taiwan President Tsai Ing-wen and United States House Speaker Kevin McCarthy du...",
                        "url": "https://abcnews.go.com/US/wireStory/china-threatens-retaliation-tsai-mccarthy-meet-98197810",
                        "image_url": "https://s.abcnews.com/images/US/wirestory_e1926816ce20590b2c7992fae8f8cd04_16x9_992.jpg",
                        "language": "en",
                        "published_at": "2023-03-29T06:02:15.000000Z",
                        "source": "abcnews.go.com",
                        "categories": [
                            "general",
                            "politics"
                        ],
                        "locale": "us"
                    },
                    {
                        "uuid": "7f5a918e-31cd-425c-8396-0ee5de9abea0",
                        "title": "Former Taiwanese leader on visit to China says war must be avoided",
                        "description": "Former Taiwan President Ma Ying-jeou called on Taipei and Beijing to do all they can to avoid war during a historic visit to the Chinese city of Nanjing.",
                        "keywords": "",
                        "snippet": "Former Taiwanese leader on visit to China says war must be avoided\n\nFormer Taiwan President Ma Ying-jeou called on Taipei and Beijing to do all they can to avoi...",
                        "url": "https://www.nbcnews.com/video/former-taiwanese-leader-on-visit-to-china-says-war-must-be-avoided-167040581731",
                        "image_url": "https://media-cldnry.s-nbcnews.com/image/upload/t_nbcnews-fp-1200-630,f_auto,q_auto:best/mpx/2704722219/2023_03/ma_33C94KK-yjxv18.jpg",
                        "language": "en",
                        "published_at": "2023-03-29T08:25:36.000000Z",
                        "source": "nbcnews.com",
                        "categories": [
                            "general",
                            "politics"
                        ],
                        "locale": "us"
                    },
                    {
                        "uuid": "5ebbc65e-58a8-43e7-84fb-adc6ddb9436c",
                        "title": "Taiwan’s Former President Makes Historic China Visit",
                        "description": "Meanwhile, the United States is trying to downplay the current Taiwanese president's stopover visit.",
                        "keywords": "",
                        "snippet": "Welcome to today’s Morning Brief.\n\nStarting April 3, we’re launching FP World Brief, a daily newsletter that will replace Morning Brief. It will run Monday ...",
                        "url": "https://foreignpolicy.com/2023/03/29/taiwans-former-president-makes-historic-china-visit/",
                        "image_url": "https://foreignpolicy.com/wp-content/uploads/2023/03/GettyImages-1249570695-1.jpg?w=1000",
                        "language": "en",
                        "published_at": "2023-03-29T10:00:33.000000Z",
                        "source": "foreignpolicy.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: 2023-03-29T16:58:53 | 2023-03-29T16:58 | 2023-03-29T16 | 2023-03-29 | 2023-03 | 2023
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: 2023-03-29T16:58:53 | 2023-03-29T16:58 | 2023-03-29T16 | 2023-03-29 | 2023-03 | 2023
published_on false Find all articles published on the specified date. Supported formats include: Y-m-d.
Examples: 2023-03-29
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": 609626,
        "returned": 10,
        "limit": 10,
        "page": 1
    },
    "data": [
        {
            "uuid": "2b9a3c45-2bda-4b01-b68e-208067fa2e09",
            "title": "Capitol riot: FBI informant testifies for Proud Boys defense",
            "description": "An FBI informant who marched to the U.S. Capitol with fellow Proud Boys members has testified that he didn’t know of any plans for the far-right extremist gro...",
            "keywords": "2021 United States Capitol riot, Violence, Politics, Trials, Law enforcement, Legal proceedings, Government and politics",
            "snippet": "An FBI informant who marched to the U.S. Capitol with fellow Proud Boys members has testified that he didn’t know of any plans for the far-right extremist gro...",
            "url": "https://abcnews.go.com/Politics/wireStory/capitol-riot-fbi-informant-testifies-proud-boys-defense-98207102",
            "image_url": "https://s.abcnews.com/images/Politics/wirestory_3324d58c9f7ba9b3c2f4b2fe7743c920_16x9_992.jpg",
            "language": "en",
            "published_at": "2023-03-29T16:47:26.000000Z",
            "source": "abcnews.go.com",
            "categories": [
                "general"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "1d288326-bb00-4dff-87e8-a47eace553ff",
            "title": "Pitch clock shaved 26 minutes off MLB spring training games",
            "description": "The use of a pitch clock shaved 26 minutes off of spring training games this year as MLB is set to use it for the first time in regular season games Thursday.",
            "keywords": "",
            "snippet": "Jesse Rogers explains how MLB players have adapted to the rule changes during Spring training. (1:49)\n\nThe use of a pitch clock shaved 26 minutes off spring tra...",
            "url": "https://www.espn.com/mlb/story/_/id/35992899/pitch-clock-shaved-26-minutes-mlb-spring-training-games",
            "image_url": "https://a4.espncdn.com/combiner/i?img=%2Fphoto%2F2023%2F0215%2Fr1131594_1296x729_16%2D9.jpg",
            "language": "en",
            "published_at": "2023-03-29T16:45:46.000000Z",
            "source": "espn.com",
            "categories": [
                "sports",
                "general"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "245b2530-0747-456b-89db-edd3da525c21",
            "title": "J&J backs out of RSV vaccine race with rivals Pfizer and GSK",
            "description": "J&J lagged behind rival drugmakers Pfizer and GSK, both of which made major strides toward U.S. approval of their RSV vaccines in the last month.",
            "keywords": "Business, GSK plc, Moderna Inc, GSK plc, Pfizer Inc, Johnson & Johnson, Health care industry, Pharmaceuticals, Biotech and Pharmaceuticals, Biotechnology, Breaking news, Breaking News: Business, business news",
            "snippet": "Johnson & Johnson on Wednesday said it's ducking out of the RSV vaccine race, weeks after competitors Pfizer and GSK inched closer to launching the world's firs...",
            "url": "https://www.cnbc.com/2023/03/29/jj-backs-out-of-rsv-vaccine-race-with-rivals-pfizer-and-gsk-.html",
            "image_url": "https://image.cnbcfm.com/api/v1/image/106097408-1566846750350rtsx61s.jpg?v=1680107286&w=1920&h=1080",
            "language": "en",
            "published_at": "2023-03-29T16:28:06.000000Z",
            "source": "cnbc.com",
            "categories": [
                "general",
                "business"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "62dcd79e-ea04-4ddf-a46f-ac4b0742eb84",
            "title": "Video Alabama bridge collapses after heavy rain and flooding",
            "description": "A man in Alabama stopped driving and started recording when he noticed the ground was gone beneath a bridge—just in time for it to crumble into the creek belo...",
            "keywords": "",
            "snippet": "Alabama bridge collapses after heavy rain and flooding A man in Alabama stopped driving and started recording when he noticed the ground was gone beneath a brid...",
            "url": "https://abcnews.go.com/US/video/alabama-bridge-collapses-after-heavy-rain-flooding-98209108",
            "image_url": "https://s.abcnews.com/images/US/230329_abc_social_bridge_hpMain_16x9_608.jpg",
            "language": "en",
            "published_at": "2023-03-29T16:24:22.000000Z",
            "source": "abcnews.go.com",
            "categories": [
                "general"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "3038f707-5c79-4598-978d-d5d294e5e24e",
            "title": "Rebel Wilson Dated Another Woman Before Fiancee Ramona Agruma",
            "description": "Rebel Wilson proposed to Ramona Agruma in February nearly one year after confirming their relationship — read more",
            "keywords": "",
            "snippet": "Before Rebel Wilson found love with fiancée Ramona Agruma, the actress was actively searching for The One.\n\n“I [did] this experiment called ‘Year of Love?...",
            "url": "https://www.usmagazine.com/celebrity-news/news/rebel-wilson-dated-another-woman-before-fiancee-ramona-agruma/",
            "image_url": "https://www.usmagazine.com/wp-content/uploads/2023/03/Rebel-Wilson-Reveals-She-Dated-Another-Woman.jpg?crop=0px%2C104px%2C1500px%2C787px&resize=1200%2C630&quality=86&strip=all",
            "language": "en",
            "published_at": "2023-03-29T16:22:36.000000Z",
            "source": "usmagazine.com",
            "categories": [
                "entertainment",
                "general"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "3f51fd12-53d1-478a-9186-e211f59ba551",
            "title": "Russia puts Pussy Riot member on wanted list for criminals",
            "description": "Russian authorities have put a member of the Pussy Riot punk group on a wanted list of criminal suspects as the Kremlin works to stifle political dissent",
            "keywords": "",
            "snippet": "Comment Gift Article Share\n\nMOSCOW — Russian authorities have put a member of the Pussy Riot punk group on a wanted list for criminal suspects as the Kremlin ...",
            "url": "https://www.washingtonpost.com/world/2023/03/29/russia-pussy-riot-list-opposition/7defc048-ce44-11ed-8907-156f0390d081_story.html",
            "image_url": "https://www.washingtonpost.com/resizer/2CjPNwqvXHPS_2RpuRTKY-p3eVo=/1484x0/www.washingtonpost.com/pb/resources/img/twp-social-share.png",
            "language": "en",
            "published_at": "2023-03-29T16:21:44.000000Z",
            "source": "washingtonpost.com",
            "categories": [
                "general",
                "politics"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "f3c45545-6fe3-4ab8-b757-d0e2ff1652df",
            "title": "King Charles III visits Germany on first foreign trip as Britain's monarch",
            "description": "The new king was meant to have started his tour to bolster U.K.-EU ties in France, but that part of the trip had to be scrapped.",
            "keywords": "King Charles III, Brexit, Britain, France, European Union, United Kingdom, Germany",
            "snippet": "Berlin — King Charles III arrived in Berlin on Wednesday for his first foreign trip as Britain's monarch, hoping to improve the U.K.'s relations with the Euro...",
            "url": "https://www.cbsnews.com/news/king-charles-iii-germany-first-foreign-trip-as-britain-monarch-eu-brexit/",
            "image_url": "https://assets2.cbsnewsstatic.com/hub/i/r/2023/03/29/73f1abaa-cf82-4748-b9bc-d8a3ded405af/thumbnail/1200x630g2/a6fa877cc1e9d518c05dd49bda6acb98/king-charles-germany-ap23088478184025.jpg",
            "language": "en",
            "published_at": "2023-03-29T16:21:00.000000Z",
            "source": "cbsnews.com",
            "categories": [
                "entertainment"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "0990e9a6-dc2f-45f5-a25f-5ee49245ab02",
            "title": "Google Is Bringing Heat Alerts to Search",
            "description": "The alerts will offer a way to find out about extreme heat and how to stay cool.",
            "keywords": "",
            "snippet": "Google announced on Wednesday that it will launch new Search alerts for extreme hot weather. The feature will be rolled out during the coming months and will pr...",
            "url": "https://www.cnet.com/tech/services-and-software/google-is-bringing-heat-alerts-to-search/#ftag=CAD590a51e",
            "image_url": "https://www.cnet.com/a/img/resize/b52b1ad5a848753b8fd09996565ec21f08647fd8/hub/2023/03/29/7be3161f-194a-4ba2-a179-b128843d7042/gettyimages-1247111151-google-alerts-phone.jpg?auto=webp&fit=crop&height=630&width=1200",
            "language": "en",
            "published_at": "2023-03-29T16:19:20.000000Z",
            "source": "cnet.com",
            "categories": [
                "tech",
                "general"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "17abea64-7b0d-402a-84f8-974bb03370d2",
            "title": "Elon Musk, Bill Gates and other tech leaders call for pause in ‘out of control’ AI race",
            "description": "Some of the biggest names in tech are calling for artificial intelligence labs to stop the training of the most powerful AI systems for at least six months, cit...",
            "keywords": "",
            "snippet": "CNN —\n\nSome of the biggest names in tech are calling for artificial intelligence labs to stop the training of the most powerful AI systems for at least six mo...",
            "url": "https://www.cnn.com/2023/03/29/tech/ai-letter-elon-musk-tech-leaders/index.html",
            "image_url": "https://media.cnn.com/api/v1/images/stellar/prod/230329090900-elon-musk-file-012423.jpg?c=16x9&q=w_800,c_fill",
            "language": "en",
            "published_at": "2023-03-29T16:18:36.000000Z",
            "source": "cnn.com",
            "categories": [
                "general"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "7cdd8b28-138d-424d-b000-fb5a0f3eeb9c",
            "title": "Feds offer $20K reward for former Larry Hogan aide on the lam",
            "description": "Federal law enforcement officials are offering up to $20,000 for information that leads to the arrest of Roy McGrath, a onetime top aide to former Maryland Gov....",
            "keywords": "News, corruption, embezzling, fbi, governor, maryland, severance, us marshals service",
            "snippet": "Federal law enforcement officials are offering up to $20,000 for information leading to the arrest of Roy McGrath, a onetime top aide to former Maryland Gov. La...",
            "url": "https://nypost.com/2023/03/29/feds-offer-20k-reward-for-roy-mcgrath-ex-larry-hogan-aide/",
            "image_url": "https://nypost.com/wp-content/uploads/sites/2/2023/03/NYPICHPDPICT000008937195.jpg?quality=75&strip=all&w=1024",
            "language": "en",
            "published_at": "2023-03-29T16:18:30.000000Z",
            "source": "nypost.com",
            "categories": [
                "general"
            ],
            "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: 2023-03-29T16:58:53 | 2023-03-29T16:58 | 2023-03-29T16 | 2023-03-29 | 2023-03 | 2023
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: 2023-03-29T16:58:53 | 2023-03-29T16:58 | 2023-03-29T16 | 2023-03-29 | 2023-03 | 2023
published_on false Find all articles published on the specified date. Supported formats include: Y-m-d.
Examples: 2023-03-29
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": 61593040,
        "returned": 10,
        "limit": 10,
        "page": 1
    },
    "data": [
        {
            "uuid": "26096ff5-6ca1-4f6e-bbd5-5f4fc08f9e6e",
            "title": "集微网",
            "description": "集微网,成立于2008年,经过近十年的发展,目前已经成为国内最知名的集成电路及手机行业门户网站。权威报道行业资讯...",
            "keywords": "集微网, 老杳吧, 芯人物, 芯视野, 芯调查, 集微拆评, 一句话点评, 专利解读",
            "snippet": "",
            "url": "https://m.laoyaoba.com/newinfo?id=854485",
            "image_url": "https://m.laoyaoba.com/static/img/logo.ico",
            "language": "zh",
            "published_at": "2023-03-29T16:58:53.000000Z",
            "source": "laoyaoba.com",
            "categories": [
                "tech"
            ],
            "relevance_score": null
        },
        {
            "uuid": "f22f337d-736e-42b9-9ce7-75eff8ead79c",
            "title": "전북도, 4급 이상 간부 공무원 인권교육",
            "description": "전북도는 29일 고위공직자의 인권 감수성 향상을 위해 4급 이상 간부 공무원 133명을 대상으로 인권교육을 실시했다. 도는...",
            "keywords": "",
            "snippet": "전북도, 4급 이상 간부 공무원 인권교육\n\n전북도는 29일 고위공직자의 인권 감수성 향상을 위해 4급 이상 간부 공무원 133?...",
            "url": "http://www.domin.co.kr/news/articleView.html?idxno=1419370",
            "image_url": "http://www.domin.co.kr/news/thumbnail/202303/1419370_568855_469_v150.jpg",
            "language": "ko",
            "published_at": "2023-03-29T16:58:48.000000Z",
            "source": "domin.co.kr",
            "categories": [],
            "relevance_score": null
        },
        {
            "uuid": "72b76cfe-c463-45c4-a985-efa9577498a3",
            "title": "Pepsi’s new logo—what designers like (and don't like) about the refresh",
            "description": "We asked the experts to weigh in—here’s what they said.",
            "keywords": "",
            "snippet": "Pum Lefebure\n\nChief Creative Officer\n\nDesign Army\n\nThe minute I saw the logo, it brought back childhood memories of a bubbly frizzy Pepsi … in a glass bottle ...",
            "url": "https://adage.com/article/creativity/pepsis-new-logo-what-designers-and-dont/2482166",
            "image_url": "https://s3-prod.adage.com/s3fs-public/styles/1200x630/public/20230324_PEPSI_2023_PR_Today_Tomorrow_3x2.jpg",
            "language": "en",
            "published_at": "2023-03-29T16:58:45.000000Z",
            "source": "adage.com",
            "categories": [
                "business"
            ],
            "relevance_score": null
        },
        {
            "uuid": "d50261bf-1a99-4a24-9ba4-d9b41192f709",
            "title": "한올바이오파마, 박수진‧정승원 공동대표 체제로 전환",
            "description": "한올바이오파마가 29일 주주총회와 이사회를 통해 대웅제약 ETC 영업본부 박수진 본부장을 사내이사 겸 공동대표이사로 ?...",
            "keywords": "",
            "snippet": "한올바이오파마가 29일 주주총회와 이사회를 통해 대웅제약 ETC 영업본부 박수진 본부장을 사내이사 겸 공동대표이사로 ?...",
            "url": "http://www.docdocdoc.co.kr/news/articleView.html?idxno=3004265",
            "image_url": "https://cdn.docdocdoc.co.kr/news/thumbnail/202303/3004265_3004683_4812_v150.jpg",
            "language": "ko",
            "published_at": "2023-03-29T16:58:44.000000Z",
            "source": "docdocdoc.co.kr",
            "categories": [],
            "relevance_score": null
        },
        {
            "uuid": "0af17c5b-7848-42e1-8890-c2ba4af23165",
            "title": "GS, 주총서 허태수 회장·홍순기 사장 사내이사 재선임",
            "description": "컨슈머타임스=박준응 기자 | GS가 29일 서울시 강남구 GS타워에서 정기 주주총회를 열고 허태수 대표이사 회장과 홍순기 ?...",
            "keywords": "",
            "snippet": "컨슈머타임스=박준응 기자 | GS가 29일 서울시 강남구 GS타워에서 정기 주주총회를 열고 허태수 대표이사 회장과 홍순기 ?...",
            "url": "https://www.cstimes.com/news/articleView.html?idxno=537568",
            "image_url": "https://www.cstimes.com/news/photo/202303/537568_444105_5829.jpg",
            "language": "ko",
            "published_at": "2023-03-29T16:58:44.000000Z",
            "source": "cstimes.com",
            "categories": [],
            "relevance_score": null
        },
        {
            "uuid": "18d39339-b6fb-46f3-afc1-d888fc6b32bb",
            "title": "集微网",
            "description": "集微网,成立于2008年,经过近十年的发展,目前已经成为国内最知名的集成电路及手机行业门户网站。权威报道行业资讯...",
            "keywords": "集微网, 老杳吧, 芯人物, 芯视野, 芯调查, 集微拆评, 一句话点评, 专利解读",
            "snippet": "",
            "url": "https://m.laoyaoba.com/newinfo?id=854483",
            "image_url": "https://m.laoyaoba.com/static/img/logo.ico",
            "language": "zh",
            "published_at": "2023-03-29T16:58:38.000000Z",
            "source": "laoyaoba.com",
            "categories": [
                "tech"
            ],
            "relevance_score": null
        },
        {
            "uuid": "5e2895cd-e1ae-448c-bb38-cede449bf6c1",
            "title": "경기옛길 550㎞ 완전개통 6개월간 완주 인증자 426명",
            "description": "경기도는 지난해 10월 경기 옛길 6대로의 마지막인 강화길(김포 옛길) 개통 후 6개월 동안 6대로를 모두 완주한 ‘명예 완?...",
            "keywords": "",
            "snippet": "문화재단, 기념촬영 공간 마련하고 명예 인증서 발급\n\n경기도는 지난해 10월 경기 옛길 6대로의 마지막인 강화길(김포 옛?...",
            "url": "http://www.shinailbo.co.kr/news/articleView.html?idxno=1681200",
            "image_url": "http://www.shinailbo.co.kr/image/logo/snslogo_20210310015526.jpg",
            "language": "ko",
            "published_at": "2023-03-29T16:58:33.000000Z",
            "source": "shinailbo.co.kr",
            "categories": [],
            "relevance_score": null
        },
        {
            "uuid": "bd8ae76a-ca92-4b76-84f7-df496636cf51",
            "title": "기시다 총리, '윤 당선자가 술을 다 마셔서 깜짝 놀랐다'.. 당연히 놀랬겠죠. : 클리앙",
            "description": "아래 기사에 보면, 일본 기시다 총리가 '윤 당선자가 건배를 하면서",
            "keywords": "",
            "snippet": "\n\n\n\n아래 기사에 보면,\n\n일본 기시다 총리가 '윤 당선자가 건배를 하면서 \"술을 다 마셔서\" 깜짝 놀랐다' 고 말했다고 하죠....",
            "url": "https://www.clien.net/service/board/park/17993291",
            "image_url": "https://edgio.clien.net/F01/13993471/a7fb95a30ea22.png",
            "language": "ko",
            "published_at": "2023-03-29T16:58:27.000000Z",
            "source": "clien.net",
            "categories": [
                "tech"
            ],
            "relevance_score": null
        },
        {
            "uuid": "66b49ee6-33e4-495a-a251-70b82dc875dd",
            "title": "청주충북환경운동연합 \"무심천·미호강 수질개선 역행하는 청주시 규탄\"",
            "description": "[중부매일 이재규 기자] 청주충북환경운동연합이 무심천과 미호강 환경개선에 역행하는 청주시를 규탄했다. 청주충?...",
            "keywords": "청주충북환경운동연합, 무심천, 미호강, ",
            "snippet": "SNS 기사보내기 카카오스토리(으)로 기사보내기 구글+(으)로 기사보내기 네이버밴드(으)로 기사보내기 카카오톡(으)로 기?...",
            "url": "http://www.jbnews.com/news/articleView.html?idxno=1388964",
            "image_url": "http://www.jbnews.com/image/logo/snslogo_20220701095855.png",
            "language": "ko",
            "published_at": "2023-03-29T16:58:25.000000Z",
            "source": "jbnews.com",
            "categories": [],
            "relevance_score": null
        },
        {
            "uuid": "a3bb2245-3837-46a1-8c1c-655a27610ac6",
            "title": "정강선 전북체육회장 시군체육회 릴레이 간담회",
            "description": "정강선 전북도체육회장이 ‘체육으로 하나되는 전라북도’를 위해 시군체육회와 본격 소통에 나선다.29일 도체육회에 ?...",
            "keywords": "",
            "snippet": "정강선 전북도체육회장이 ‘체육으로 하나되는 전라북도’를 위해 시군체육회와 본격 소통에 나선다.\n\n정강선 전북도체...",
            "url": "http://www.domin.co.kr/news/articleView.html?idxno=1419343",
            "image_url": "http://www.domin.co.kr/news/thumbnail/202303/1419343_568822_5859_v150.jpg",
            "language": "ko",
            "published_at": "2023-03-29T16:58:25.000000Z",
            "source": "domin.co.kr",
            "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: 2023-03-29T16:58:53 | 2023-03-29T16:58 | 2023-03-29T16 | 2023-03-29 | 2023-03 | 2023
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: 2023-03-29T16:58:53 | 2023-03-29T16:58 | 2023-03-29T16 | 2023-03-29 | 2023-03 | 2023
published_on false Find all articles published on the specified date. Supported formats include: Y-m-d.
Examples: 2023-03-29
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=2023-03-22
    

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();
    

More

Stock Market News APIs

We also provide a dedicated finance and stock market news and analysis API, perfect for financial apps. Check it out here: marketaux.com.