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 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-09-30
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": "0cec7883-fafa-4e15-a3d3-1fb6b8f264b0",
                "title": "First co-defendant in Trump Georgia election case pleads guilty",
                "description": "Scott Hall, one of 18 co-defendants of former President Donald Trump in the Georgia election interference case, pleaded guilty to the charges against him.",
                "keywords": "Breaking News: Politics, business news",
                "snippet": "Republican poll watcher Scott Hall is shown in a police booking mugshot released by the Fulton County Sheriff's Office, after a grand jury brought back indictme...",
                "url": "https://www.cnbc.com/2023/09/29/first-co-defendant-in-trump-georgia-election-case-pleads-guilty.html",
                "image_url": "https://image.cnbcfm.com/api/v1/image/107309419-1696016568157-hall.jpg?v=1696016675&w=1920&h=1080",
                "language": "en",
                "published_at": "2023-09-29T19:44:49.000000Z",
                "source": "cnbc.com",
                "categories": [
                    "general",
                    "business"
                ],
                "locale": "us",
                "similar": [
                    {
                        "uuid": "1df41268-7876-4268-b0c2-58484706e5b2",
                        "title": "In Georgia case, one defendant reaches plea deal with prosecutors",
                        "description": "In the Georgia election interference case, Donald Trump was one of 19 co-defendants. Now, one of the 19 is pleading guilty as part of a plea deal.",
                        "keywords": "",
                        "snippet": "When Donald Trump was indicted in Fulton County, it was a dramatic development, but the former president wasn’t the only one charged in the election interfere...",
                        "url": "https://www.msnbc.com/rachel-maddow-show/maddowblog/scott-hall-plea-guilty-trump-georgia-rcna118153",
                        "image_url": "https://media-cldnry.s-nbcnews.com/image/upload/t_nbcnews-fp-1200-630,f_auto,q_auto:best/rockcms/2023-09/230929-scott-hall-mjf-1559-3d39b7.jpg",
                        "language": "en",
                        "published_at": "2023-09-29T20:04:19.000000Z",
                        "source": "msnbc.com",
                        "categories": [
                            "general",
                            "politics"
                        ],
                        "locale": "us"
                    },
                    {
                        "uuid": "eaf73c79-6cc8-417e-bf87-35ca4a0b8890",
                        "title": "Scott Hall, bail bondsman charged alongside Trump in Georgia, becomes the first defendant to take a plea deal",
                        "description": "ATLANTA — A bail bondsman charged alongside former President Donald Trump and 17 others has become the first defendant in the Georgia election interference case to accept a plea deal with prosecutors.",
                        "keywords": "News, donald trump, georgia, indictment",
                        "snippet": "ATLANTA — A bail bondsman charged alongside former President Donald Trump and 17 others has become the first defendant in the Georgia election interference ca...",
                        "url": "https://nypost.com/2023/09/29/bail-bondsman-charged-alongside-trump-in-georgia-becomes-the-first-defendant-to-take-a-plea-deal/",
                        "image_url": "https://nypost.com/wp-content/uploads/sites/2/2023/09/newspress-collage-37o1xir99-1696019737327.jpg?quality=75&strip=all&1696005358&w=1024",
                        "language": "en",
                        "published_at": "2023-09-29T20:37:53.000000Z",
                        "source": "nypost.com",
                        "categories": [
                            "general"
                        ],
                        "locale": "us"
                    },
                    {
                        "uuid": "b5fa1aaa-b584-429c-abb9-6f517b4ff521",
                        "title": "Trump co-defendant pleads guilty in Georgia, becoming first to reach plea deal in election-subversion case",
                        "description": "Part of the plea deal for Scott Hall, a bail bondsman who breached election equipment, requires him to testify against other co-defendants.",
                        "keywords": "",
                        "snippet": "Trump was not mentioned by name during Hall’s plea hearing, but a Fulton County prosecutor did mention co-defendant and former Trump attorney Sidney Powell as...",
                        "url": "https://www.politico.com/news/2023/09/29/trump-georgia-plea-deal-bail-bondsman-00119232",
                        "image_url": "https://static.politico.com/6a/0c/41f6354e4518b0d54f23bc53bee3/georgia-election-indictment-88571.jpg",
                        "language": "en",
                        "published_at": "2023-09-29T21:48:47.000000Z",
                        "source": "politico.com",
                        "categories": [
                            "politics",
                            "general"
                        ],
                        "locale": "us"
                    },
                    {
                        "uuid": "b9d4aca5-cf8e-47aa-913f-ed7243d97517",
                        "title": "Trump ally pleads guilty in election interference case",
                        "description": "Bail bondsman Scott Hall becomes first Trump ally to enter guilty plea for role in alleged election interference in US state Georgia",
                        "keywords": "",
                        "snippet": "Scott Hall has become the first co-defendant to make a plea bargain in the Georgia case\n\nGeorgia bail bondsman Scott Hall, a former Republican poll watcher and ...",
                        "url": "https://www.rt.com/news/583803-trump-ally-guilty-election-interference/",
                        "image_url": "https://mf.b37mrtl.ru/files/2023.09/article/651755b62030273f5c71f394.jpg",
                        "language": "en",
                        "published_at": "2023-09-29T22:56:48.000000Z",
                        "source": "rt.com",
                        "categories": [
                            "general",
                            "politics"
                        ],
                        "locale": "us"
                    },
                    {
                        "uuid": "ac42e592-9c65-43f0-9e2b-da35736c7988",
                        "title": "Bail bondsman charged with Trump and 17 others in Georgia election case becomes first defendant to take plea deal",
                        "description": "Bail bondsman charged with Trump and 17 others in Georgia election case becomes first defendant to take plea deal",
                        "keywords": "Legal proceedings, Politics, Elections, Washington news, General news, U.S. news, Article, 103611395",
                        "snippet": "Bail bondsman charged with Trump and 17 others in Georgia election case becomes first defendant to take plea deal\n\nBail bondsman charged with Trump and 17 other...",
                        "url": "https://abcnews.go.com/US/wireStory/bail-bondsman-charged-trump-17-georgia-election-case-103611395",
                        "image_url": "https://s.abcnews.com/images/US/abc_news_default_2000x2000_update_16x9_992.jpg",
                        "language": "en",
                        "published_at": "2023-09-29T20:31:25.000000Z",
                        "source": "abcnews.go.com",
                        "categories": [
                            "general",
                            "politics"
                        ],
                        "locale": "us"
                    }
                ]
            },
            {
                "uuid": "897c9c3c-1ca9-4e7d-9f11-4303bda7e516",
                "title": "RFK Jr. will ditch Democratic Party and announce independent run: report",
                "description": "White House hopeful Robert F. Kennedy Jr. will drop his bid to challenge President Biden for the Democratic presidential nomination and instead mount a third-party campaign for president.",
                "keywords": "News, 2024 presidential election, democratic party, joe biden, robert f. kennedy jr.",
                "snippet": "White House hopeful Robert F. Kennedy Jr. will drop his bid to challenge President Biden for the Democratic presidential nomination and instead mount a third-pa...",
                "url": "https://nypost.com/2023/09/30/rfk-jr-will-ditch-democratic-party-and-announce-independent-run-report/",
                "image_url": "https://nypost.com/wp-content/uploads/sites/2/2023/09/RFK-Run-comp-1-1.jpg?quality=75&strip=all&w=1024",
                "language": "en",
                "published_at": "2023-09-30T05:11:22.000000Z",
                "source": "nypost.com",
                "categories": [
                    "general"
                ],
                "locale": "us",
                "similar": [
                    {
                        "uuid": "57b86a51-ccac-4cc1-8b9b-16bd0f96dc48",
                        "title": "Kennedy to run as third-party presidential candidate – media",
                        "description": "US presidential candidate Robert F. Kennedy Jr. reportedly to announce he will run as an independent, rather than seek Democrat nomination",
                        "keywords": "",
                        "snippet": "Robert F. Kennedy Jr. has reportedly decided to compete as an independent, potentially pulling votes away from incumbent Joe Biden\n\nUS presidential candidate Ro...",
                        "url": "https://www.rt.com/news/583802-kennedy-independent-presidential-candidate/",
                        "image_url": "https://mf.b37mrtl.ru/files/2023.09/article/6517499585f54010ac005b29.jpg",
                        "language": "en",
                        "published_at": "2023-09-29T22:06:22.000000Z",
                        "source": "rt.com",
                        "categories": [
                            "general",
                            "politics"
                        ],
                        "locale": "us"
                    },
                    {
                        "uuid": "4bb5b82f-5621-44ed-a3a4-46d0ea951444",
                        "title": "RFK Jr teases ‘major announcement’ as speculation swirls about independent run",
                        "description": "2024 hopeful Robert F. Kennedy Jr. teased a \"major announcement\" early next month, fueling speculation that he will no longer run as a Democrat and launch an independent bid.",
                        "keywords": "",
                        "snippet": "Democratic presidential candidate Robert F. Kennedy Jr. is teasing a \"major announcement,\" fueling speculation that he will be running as an independent.\n\n\"I'm ...",
                        "url": "https://www.foxnews.com/politics/rfk-jr-teases-major-announcement-speculation-swirls-independent-run",
                        "image_url": "https://static.foxnews.com/foxnews.com/content/uploads/2023/04/GettyImages-1252012556.jpg",
                        "language": "en",
                        "published_at": "2023-09-29T23:00:04.000000Z",
                        "source": "foxnews.com",
                        "categories": [
                            "general",
                            "politics"
                        ],
                        "locale": "us"
                    },
                    {
                        "uuid": "14b8e713-a99a-49ad-885c-87055f1f7ea9",
                        "title": "RFK Jr. denied Secret Service protection despite numerous threats",
                        "description": "Democratic presidential candidate Robert F. Kennedy Jr. has been denied Secret Service protection despite the agency determining that he is at an elevated “risk for adverse attention,” documents show.",
                        "keywords": "News, 2024 presidential election, robert f. kennedy jr., secret service",
                        "snippet": "Democratic presidential candidate Robert F. Kennedy Jr. has been denied Secret Service protection despite the agency determining that he is at an elevated “ri...",
                        "url": "https://nypost.com/2023/09/29/rfk-jr-denied-secret-service-protection-despite-numerous-threats/",
                        "image_url": "https://nypost.com/wp-content/uploads/sites/2/2023/09/NYPICHPDPICT000053149608.jpg?quality=75&strip=all&w=1024",
                        "language": "en",
                        "published_at": "2023-09-30T01:33:18.000000Z",
                        "source": "nypost.com",
                        "categories": [
                            "general"
                        ],
                        "locale": "us"
                    },
                    {
                        "uuid": "2ed59271-6a01-4ecb-a578-bec2750675eb",
                        "title": "RFK Jr. teases announcement amid speculation he will make independent or third-party run",
                        "description": "Environmental lawyer and 2024 presidential hopeful Robert F. Kennedy Jr. on Friday teased a “major announcement” in upcoming weeks amid speculation he is considering dropping his bid to primary President Joe Biden as a Democrat and instead running for president as an independent or on a third-party ticket.",
                        "keywords": "2024 presidential election, domestic alerts, domestic-election 2024, domestic-us politics, election polls, elections (by type), elections and campaigns, government and public administration, iab-elections, iab-politics, international alerts, international-election 2024, international-us politics, kennedy family, misc people, political candidates, political parties, politics, robert f. kennedy, jr., third-party candidates, us elections, us federal elections, us presidential elections",
                        "snippet": "CNN —\n\nEnvironmental lawyer and 2024 presidential hopeful Robert F. Kennedy Jr. on Friday teased a “major announcement” in upcoming weeks amid speculation...",
                        "url": "https://www.cnn.com/2023/09/29/politics/robert-kennedy-major-announcement-2024/index.html",
                        "image_url": "https://media.cnn.com/api/v1/images/stellar/prod/230929191835-rfk-jr-file-092923.jpg?c=16x9&q=w_800,c_fill",
                        "language": "en",
                        "published_at": "2023-09-30T01:35:42.000000Z",
                        "source": "cnn.com",
                        "categories": [
                            "general"
                        ],
                        "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-09-30T06:47:43 | 2023-09-30T06:47 | 2023-09-30T06 | 2023-09-30 | 2023-09 | 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-09-30T06:47:43 | 2023-09-30T06:47 | 2023-09-30T06 | 2023-09-30 | 2023-09 | 2023
published_on false Find all articles published on the specified date. Supported formats include: Y-m-d.
Examples: 2023-09-30
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": 817401,
        "returned": 10,
        "limit": 10,
        "page": 1
    },
    "data": [
        {
            "uuid": "112d05f0-37b0-4db1-b48c-f624c5b32367",
            "title": "Indiana mother allegedly drowns 2 toddlers after doing drugs, says voices told her to send them to heaven",
            "description": "An Indiana woman allegedly confessing to drowning her two children after using drugs and hearing voices in her head telling her to kill them or the three of the...",
            "keywords": "",
            "snippet": "An Indiana woman confessed to officials that she drowned her own two children after using drugs and hearing voices in her head that told her to \"send her childr...",
            "url": "https://www.foxnews.com/us/indiana-mother-allegedly-drowns-2-toddlers-after-doing-drugs-says-voices-told-her-send-them-heaven",
            "image_url": "https://static.foxnews.com/foxnews.com/content/uploads/2023/09/lawrencesheriff.png",
            "language": "en",
            "published_at": "2023-09-30T06:23:35.000000Z",
            "source": "foxnews.com",
            "categories": [
                "general",
                "politics"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "96125f87-2d7e-4472-9b70-42a95f00e6ef",
            "title": "Russian energy revenues set to rise – Finance Ministry",
            "description": "Moscow expects revenues from oil and gas exports to surge by a third as it reduces discounts, the Finance Ministry says",
            "keywords": "",
            "snippet": "Oil and gas profits are expected to soar by 30% next year, according to a report\n\nRussia’s revenues from oil and gas exports could surge by almost a third nex...",
            "url": "https://www.rt.com/business/583764-russia-oil-gas-revenues-rise/",
            "image_url": "https://mf.b37mrtl.ru/files/2023.09/article/6516b31785f54010ac005ac7.jpg",
            "language": "en",
            "published_at": "2023-09-30T06:21:38.000000Z",
            "source": "rt.com",
            "categories": [
                "general",
                "politics"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "10659e47-2634-443c-9016-c0921b5c6fdb",
            "title": "China unveils Moon plans",
            "description": "China’s space agency has offered details about its next mission to the Moon, with a launch planned for next year",
            "keywords": "",
            "snippet": "The upcoming mission will aim to collect material from the far side of the lunar surface in 2024\n\nChina's space agency has offered details about its next journe...",
            "url": "https://www.rt.com/news/583809-china-moon-mission-plans/",
            "image_url": "https://mf.b37mrtl.ru/files/2023.09/article/6517ac612030272d60058694.jpg",
            "language": "en",
            "published_at": "2023-09-30T05:33:24.000000Z",
            "source": "rt.com",
            "categories": [
                "general",
                "politics"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "955c0cbc-44f5-42ae-bdbe-fed56ea8f677",
            "title": "Emerging election issues in New Jersey include lawsuits over outing trans students, offshore wind",
            "description": "New Jersey Republicans are seizing on flashpoint issues ahead of this November's election",
            "keywords": "Politics, Elections, Legal proceedings, U.S. news, General news, Article, 103620791",
            "snippet": "FILE - The Capital dome is seen at the New Jersey Statehouse, June 30, 2016, in Trenton, N.J. New Jersey Republicans are seizing on recent state attorney genera...",
            "url": "https://abcnews.go.com/US/wireStory/emerging-election-issues-new-jersey-include-lawsuits-outing-103620791",
            "image_url": "https://i.abcnewsfe.com/a/1cc5ccf1-8943-420a-a2b2-f5a70d4d49b0/wirestory_9b9ca534b0b3a125afdd98e385403740_16x9.jpg?w=992",
            "language": "en",
            "published_at": "2023-09-30T05:26:46.000000Z",
            "source": "abcnews.go.com",
            "categories": [
                "general",
                "politics"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "28bfec98-280d-4406-9372-b56fbd879a16",
            "title": "Aces complete sweep of Wings to return to WNBA Finals",
            "description": "The Aces scored the final 11 points and rallied for a 64-61 win over the Wings on Friday night, completing a series sweep to return to the WNBA Finals for the t...",
            "keywords": "",
            "snippet": "The Aces complete a sweep of the Wings with an 11-0 run to send Las Vegas to the WNBA Finals. (1:18)\n\nAces go on 11-0 run to advance to WNBA Finals (1:18)\n\nARLI...",
            "url": "https://www.espn.com/wnba/story/_/id/38524533/aces-complete-sweep-wings-return-wnba-finals",
            "image_url": "https://a2.espncdn.com/combiner/i?img=%2Fphoto%2F2023%2F0930%2Fr1231678_1296x729_16%2D9.jpg",
            "language": "en",
            "published_at": "2023-09-30T05:25:20.000000Z",
            "source": "espn.com",
            "categories": [
                "sports",
                "general"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "365ea74d-1227-4ad8-9eef-17fa5c7e6e53",
            "title": "Tensions reach boiling point in House GOP meeting hours before expected government shutdown",
            "description": "House Republicans are scrambling for a way forward while facing a likely government shutdown.",
            "keywords": "",
            "snippet": "House Republicans left a closed-door conference meeting on Friday night frustrated and with no clear path forward on averting a government shutdown.\n\nGovernment...",
            "url": "https://www.foxnews.com/politics/tensions-reach-boiling-point-house-gop-meeting-hours-before-expected-government-shutdown",
            "image_url": "https://static.foxnews.com/foxnews.com/content/uploads/2023/07/GettyImages-1570117614.jpg",
            "language": "en",
            "published_at": "2023-09-30T05:18:20.000000Z",
            "source": "foxnews.com",
            "categories": [
                "general",
                "politics"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "897c9c3c-1ca9-4e7d-9f11-4303bda7e516",
            "title": "RFK Jr. will ditch Democratic Party and announce independent run: report",
            "description": "White House hopeful Robert F. Kennedy Jr. will drop his bid to challenge President Biden for the Democratic presidential nomination and instead mount a third-pa...",
            "keywords": "News, 2024 presidential election, democratic party, joe biden, robert f. kennedy jr.",
            "snippet": "White House hopeful Robert F. Kennedy Jr. will drop his bid to challenge President Biden for the Democratic presidential nomination and instead mount a third-pa...",
            "url": "https://nypost.com/2023/09/30/rfk-jr-will-ditch-democratic-party-and-announce-independent-run-report/",
            "image_url": "https://nypost.com/wp-content/uploads/sites/2/2023/09/RFK-Run-comp-1-1.jpg?quality=75&strip=all&w=1024",
            "language": "en",
            "published_at": "2023-09-30T05:11:22.000000Z",
            "source": "nypost.com",
            "categories": [
                "general"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "ed5a7b10-8eae-47c2-833b-c8f8e319d3e5",
            "title": "China changes position on key Russian meat export",
            "description": "Beijing has lifted restrictions on imports of qualified Russian pork, the Russian agricultural watchdog has announced",
            "keywords": "",
            "snippet": "Beijing has agreed to allow pork imports from Russia after a 15-year halt, with the first deliveries expected by mid-2024\n\nChina has lifted a ban on imports of ...",
            "url": "https://www.rt.com/business/583757-china-russia-pork-exports/",
            "image_url": "https://mf.b37mrtl.ru/files/2023.09/article/6516cbd785f5400ef5231727.jpg",
            "language": "en",
            "published_at": "2023-09-30T05:10:42.000000Z",
            "source": "rt.com",
            "categories": [
                "general",
                "politics"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "726600d4-56b6-415a-8d9b-1065d872e4b6",
            "title": "All the Palestinians Got From Oslo Was KFC",
            "description": "Thirty years of the peace process has left us with less land and fewer rights.",
            "keywords": "",
            "snippet": "The year was 2003. The West Bank was still battered, its smooth limestone exteriors pock-marked with bullet holes and roads shattered under the weight of Israel...",
            "url": "https://foreignpolicy.com/2023/09/30/oslo-peace-process-palestinian-authority-israel/",
            "image_url": "https://foreignpolicy.com/wp-content/uploads/2023/09/palestinian-west-bank-oslo-accords-israel-GettyImages-1252522656.jpg?w=1000",
            "language": "en",
            "published_at": "2023-09-30T05:00:37.000000Z",
            "source": "foreignpolicy.com",
            "categories": [
                "general",
                "politics"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "5db0fff7-b05e-4c76-8661-4e77ac7c74e6",
            "title": "Russia failed to keep peace in Nagorno-Karabakh, pivoting away from Armenia",
            "description": "Russian President Vladimir Putin promised to uphold a cease-fire in Nagorno-Karabakh and protect its residents. He did neither, perhaps in a purposeful shift to...",
            "keywords": "",
            "snippet": "Listen 8 min Share Comment\n\nRIGA, Latvia — With virtually the entire population of Armenians feeling from Nagorno-Karabakh, refugees are voicing rage over the...",
            "url": "https://www.washingtonpost.com/world/2023/09/30/russia-nagorno-karabakh-peacekeepers-failure/",
            "image_url": "https://www.washingtonpost.com/wp-apps/imrs.php?src=https://arc-anglerfish-washpost-prod-washpost.s3.amazonaws.com/public/TGC6UROMRQ63LVBB7CYRCIQ5QM_size-normalized.jpg&w=1440",
            "language": "en",
            "published_at": "2023-09-30T05:00:29.000000Z",
            "source": "washingtonpost.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: 2023-09-30T06:47:43 | 2023-09-30T06:47 | 2023-09-30T06 | 2023-09-30 | 2023-09 | 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-09-30T06:47:43 | 2023-09-30T06:47 | 2023-09-30T06 | 2023-09-30 | 2023-09 | 2023
published_on false Find all articles published on the specified date. Supported formats include: Y-m-d.
Examples: 2023-09-30
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": 47856176,
        "returned": 10,
        "limit": 10,
        "page": 1
    },
    "data": [
        {
            "uuid": "0871f8d3-d96c-4374-9290-5d01a274c8d4",
            "title": "Dotacje do pszenicy, kukurydzy i gryki. Ile pieniędzy wypłacono? Co z pozostałymi zbożami?",
            "description": "Trwają wypłaty dla rolników, którzy ubiegali się o wsparcie w związku ze sprzedażą pszenicy, kukurydzy lub gryki. Ile trafiło już na konta rolników? ...",
            "keywords": "",
            "snippet": "Trwają wypłaty dla rolników, którzy ubiegali się o wsparcie w związku ze sprzedażą pszenicy, kukurydzy lub gryki. Ile trafiło już na konta rolników? ...",
            "url": "https://www.farmer.pl/finanse/dotacje-i-doplaty/dotacje-do-pszenicy-kukurydzy-i-gryki-ile-pieniedzy-wyplacono-co-z-pozostalymi-zbozami,136597.html",
            "image_url": "https://pliki.farmer.pl/i/17/30/46/173046_r2_940.jpg",
            "language": "pl",
            "published_at": "2023-09-30T06:47:09.000000Z",
            "source": "farmer.pl",
            "categories": [],
            "relevance_score": null
        },
        {
            "uuid": "a9ffb15d-8b4d-4166-a786-16346f49b81a",
            "title": "에코프로 투자자들 속타게한 인버스 ETF…“여전히 잘 나간다” [투자360]",
            "description": "KB자산운용이 업계최초로 2차전지 주가 하락세에 베팅하는 ‘KBSTAR 2차전지TOP10인버스(합성)’를 지난 12일 출시했다. 2차?...",
            "keywords": "헤럴드경제, 헤경, heraldcorp, 경제지, 신문, 뉴스, 보도, 속보, 정치, 경제, 사회, 국제, 문화, 사설, 컬럼, News, Newspaper, Korea, South Korea, Rep.Korea",
            "snippet": "11거래일 동안 수익률 8.5%\n\n개인순매수 370억원\n\n[게티이미지뱅크]\n\n[헤럴드경제=윤호 기자] KB자산운용이 업계최초로 2차전...",
            "url": "https://biz.heraldcorp.com/view.php?ud=20230927000750",
            "image_url": "https://res.heraldm.com/content/image/2023/09/27/20230927000814_p.jpg",
            "language": "ko",
            "published_at": "2023-09-30T06:46:35.000000Z",
            "source": "biz.heraldcorp.com",
            "categories": [
                "general"
            ],
            "relevance_score": null
        },
        {
            "uuid": "337db23c-3841-4197-9804-ea8305e052b6",
            "title": "미국증시, 나스닥100 '강보합'...엔비디아 '상승', 마이크론 '껑충'",
            "description": "[초이스경제 이영란 기자] 29일(이하 현지시간) 뉴욕증시 3대 지수가 혼조세로 마감한 가운데 나스닥100 지수는 강보합세?...",
            "keywords": "",
            "snippet": "미국 버지니아주 마이크론 공장. /사진=AP, 뉴시스\n\n[초이스경제 이영란 기자] 29일(이하 현지시간) 뉴욕증시 3대 지수가 혼...",
            "url": "http://www.choicenews.co.kr/news/articleView.html?idxno=121192",
            "image_url": "https://cdn.choicenews.co.kr/news/thumbnail/202309/121192_86249_4547_v150.jpg",
            "language": "ko",
            "published_at": "2023-09-30T06:46:03.000000Z",
            "source": "choicenews.co.kr",
            "categories": [],
            "relevance_score": null
        },
        {
            "uuid": "3a0d1a9e-757c-4852-af18-e5a6089bdc9a",
            "title": "当好粮食稳产保供压舱石-中新网",
            "description": "",
            "keywords": "粮食产业, 土壤质量下降, 粮食综合生产能力, 粮食生产基地, 精深加工",
            "snippet": "习近平总书记日前主持召开新时代推动东北全面振兴座谈会时强调,当好国家粮食稳产保供“压舱石”,是东北的首要担?...",
            "url": "https://www.chinanews.com.cn/cj/2023/09-30/10087303.shtml",
            "image_url": "https://www.chinanews.com.cn/2023/09-28/U610P4T8D10086577F5012DT20230928200820.jpg",
            "language": "zh",
            "published_at": "2023-09-30T06:45:48.000000Z",
            "source": "chinanews.com",
            "categories": [],
            "relevance_score": null
        },
        {
            "uuid": "39828fd2-cbca-4541-9556-60d7efc69e00",
            "title": "[뉴욕유가] 셧다운 우려 속 하락…9월에만 8.6%↑",
            "description": "뉴욕유가는 연방정부의 셧다운 가능성이 커지고, 연방준비제도(연준·Fed) 선호 인플레이션 지표가 둔화했다는 소식 등에...",
            "keywords": "",
            "snippet": "텍사스 엘파소 지역에 있는 원유 저장 시설\n\n[연합뉴스 자료사진]\n\n29일(현지시간) 뉴욕상업거래소에서 11월 인도 서부텍?...",
            "url": "https://news.einfomax.co.kr/news/articleView.html?idxno=4282648",
            "image_url": "https://cdn.news.einfomax.co.kr/news/thumbnail/202309/4282648_167378_461_v150.jpg",
            "language": "ko",
            "published_at": "2023-09-30T06:45:28.000000Z",
            "source": "t240.ndsoftnews.com",
            "categories": [],
            "relevance_score": null
        },
        {
            "uuid": "a9a71776-ca99-4ef0-b781-8c5f244fdf3b",
            "title": "老字号打造新生态商业空间-中新网",
            "description": "",
            "keywords": "生态商业, 商业项目, 新阶段, 新国, 新体验",
            "snippet": "近日,位于北京市王府井大街的北京市百货大楼一年一度的周年庆活动如约而至。作为国内最大的零售集团之一,从“新?...",
            "url": "https://www.chinanews.com.cn/cj/2023/09-30/10087302.shtml",
            "image_url": "https://www.chinanews.com.cn/2023/09-28/U610P4T8D10086577F5012DT20230928200820.jpg",
            "language": "zh",
            "published_at": "2023-09-30T06:45:10.000000Z",
            "source": "chinanews.com",
            "categories": [],
            "relevance_score": null
        },
        {
            "uuid": "85ee69e8-d3bb-449d-87da-a9668dedc767",
            "title": "松绑路边摊还需更精细-中新网",
            "description": "",
            "keywords": "路边摊, 条例, 点位, 车尾, 深圳市司法局",
            "snippet": "新修订的《深圳经济特区市容和环境卫生管理条例》已正式实施,该《条例》因不再全面禁止路边摊而备受关注。条例实?...",
            "url": "https://www.chinanews.com.cn/cj/2023/09-30/10087301.shtml",
            "image_url": "https://www.chinanews.com.cn/2023/09-28/U610P4T8D10086577F5012DT20230928200820.jpg",
            "language": "zh",
            "published_at": "2023-09-30T06:45:06.000000Z",
            "source": "chinanews.com",
            "categories": [],
            "relevance_score": null
        },
        {
            "uuid": "9247b49a-4e45-4ddc-8aed-f7bd432186fe",
            "title": "科?",
            "description": "",
            "keywords": "",
            "snippet": "",
            "url": "https://blog.sciencenet.cn/home.php?mod=space&uid=2277&do=blog&id=1404261",
            "image_url": "",
            "language": "zh",
            "published_at": "2023-09-30T06:45:05.000000Z",
            "source": "blog.sciencenet.cn",
            "categories": [
                "science"
            ],
            "relevance_score": null
        },
        {
            "uuid": "fffd0ac7-5e7c-4ef8-a3a0-a312523c634e",
            "title": "新能源车维修定损标准逐步规范-中新网",
            "description": "",
            "keywords": "新能源汽车, 定损, 电池检测, 随机故障, 维修成本",
            "snippet": "公安部发布的数据显示,截至6月底,全国新能源汽车保有量达1620万辆,占汽车总量的4.9%。其中,纯电动汽车保有量1259.4?...",
            "url": "https://www.chinanews.com.cn/cj/2023/09-30/10087300.shtml",
            "image_url": "https://www.chinanews.com.cn/2023/09-28/U610P4T8D10086577F5012DT20230928200820.jpg",
            "language": "zh",
            "published_at": "2023-09-30T06:45:01.000000Z",
            "source": "chinanews.com",
            "categories": [],
            "relevance_score": null
        },
        {
            "uuid": "374cf7c5-5d2e-4487-8d69-f87b3ce88ed4",
            "title": "MVL beats Carlsen twice, wins AI Cup",
            "description": "With a remarkable performance, Maxime Vachier-Lagrave got to beat Magnus Carlsen in two consecutive matches to win the AI Cup, the sixth and final ‘regular’...",
            "keywords": "",
            "snippet": "“That was a fair outcome”\n\nMagnus Carlsen has shown incredible results throughout the 2023 Champions Chess Tour (and since the start of the era of online, e...",
            "url": "https://en.chessbase.com/post/ai-cup-2023-d5",
            "image_url": "https://en.chessbase.com/thumb/113551_l200",
            "language": "en",
            "published_at": "2023-09-30T06:45:00.000000Z",
            "source": "en.chessbase.com",
            "categories": [
                "sports"
            ],
            "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-09-30T06:47:43 | 2023-09-30T06:47 | 2023-09-30T06 | 2023-09-30 | 2023-09 | 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-09-30T06:47:43 | 2023-09-30T06:47 | 2023-09-30T06 | 2023-09-30 | 2023-09 | 2023
published_on false Find all articles published on the specified date. Supported formats include: Y-m-d.
Examples: 2023-09-30
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-09-23
    

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.