Getting Started

Introduction

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

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

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

Authentication

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

API Endpoints

Headlines Available on: Standard plan and above

Endpoint

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

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

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

All text data returned is UTF-8.

All dates are in UTC (GMT).

HTTP GET Parameters

name required description
api_token true Your API token which can be found on your account dashboard.
locale false Comma separated list of country codes to include in the result set. Default is all countries. Click here for a list of supported countries.
Example: us,ca (US + Canada).
domains false Comma separated list of domains to include. List of domains can be obtained through our Sources endpoint, found further down this page.
exclude_domains false Comma separated list of domains to exclude
source_ids false Comma separated list of source_ids to include. List of source_ids can be obtained through our Sources endpoint, found further down this page.
exclude_source_ids false Comma separated list of source_ids to exclude.
language false Comma separated list of languages to include. Default is all.
Click here for a list of supported languages.
Examples: en,es (English + Spanish)
published_on false Find headlines for articles published on the specified date. Supported formats include: Y-m-d.
Examples: 2024-06-22
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": "0e1e497f-d7f6-44da-a50f-7d7d0e6250db",
                "title": "Jason Kelce Holds Beer While Exchanging Friendship Bracelets at Eras Tour",
                "description": "Jason Kelce was spotted at London’s ‘Eras Tour’ concert showing off his sleeves of friendship bracelets, with some even dangling from his ears",
                "keywords": "",
                "snippet": "Jason Kelce went full Swiftie while attending Taylor Swift’s first Eras Tour concert at Wembley Stadium in London.\n\nJason, 36, showed off his collection of fr...",
                "url": "https://www.usmagazine.com/celebrity-news/news/jason-kelce-holds-beer-while-exchanging-friendship-bracelets-at-eras-tour/",
                "image_url": "https://www.usmagazine.com/wp-content/uploads/2024/06/Jason-Kelce-Expertly-Holds-Beer-While-Adjusting-Friendship-Bracelet-Sleeves-at-London-Eras-Tour.jpg?crop=0px%2C82px%2C1488px%2C781px&resize=1200%2C630&quality=86&strip=all",
                "language": "en",
                "published_at": "2024-06-22T19:00:30.000000Z",
                "source": "usmagazine.com",
                "categories": [
                    "entertainment",
                    "general"
                ],
                "locale": "us",
                "similar": [
                    {
                        "uuid": "f360a85b-865f-41b2-ad24-36fb2de85a0a",
                        "title": "How the royal family, London Zoo are welcoming Taylor Swift’s ‘Eras Tour’",
                        "description": "Taylor Swift started her first of eight “Eras Tour” shows in London on Friday night — and the British city is already ready for it.",
                        "keywords": "",
                        "snippet": "Taylor Swift started her first of eight “Eras Tour” shows in London on Friday night — and the British city is already ready for it.\n\nThe official X accoun...",
                        "url": "https://www.nbcnews.com/news/world/taylor-swifts-eras-tour-london-royal-family-rcna158409",
                        "image_url": "https://media-cldnry.s-nbcnews.com/image/upload/t_nbcnews-fp-1200-630,f_auto,q_auto:best/rockcms/2024-06/240622-taylor-swift-ldn-wc-1113-b43221.jpg",
                        "language": "en",
                        "published_at": "2024-06-22T12:35:32.000000Z",
                        "source": "nbcnews.com",
                        "categories": [
                            "general",
                            "politics"
                        ],
                        "locale": "us"
                    },
                    {
                        "uuid": "8d92195a-d4d1-4085-8dfc-6a71db7b7c15",
                        "title": "Taylor Swift takes selfie with Prince William and his children at Eras Tour show in London",
                        "description": "Taylor Swift posed for selfies with Prince William Prince George, Princess Charlotte and boyfriend Travis Kelce during her show in London.",
                        "keywords": "",
                        "snippet": "Taylor Swift was greeted with a warm welcome from Prince William and his two oldest children, Prince George and Princess Charlotte, during her \"Eras Tour\" stop ...",
                        "url": "https://www.foxnews.com/entertainment/taylor-swift-takes-selfie-prince-william-his-children-eras-tour-show-london",
                        "image_url": "https://static.foxnews.com/foxnews.com/content/uploads/2024/06/taylor-1.jpg",
                        "language": "en",
                        "published_at": "2024-06-22T13:52:02.000000Z",
                        "source": "foxnews.com",
                        "categories": [
                            "general",
                            "politics"
                        ],
                        "locale": "us"
                    },
                    {
                        "uuid": "5ff853ca-4163-4a12-8ebe-4d4d56a04d97",
                        "title": "Taylor Swift's London 'Eras Tour' Concerts: Every Celeb Guest",
                        "description": "Taylor Swift played eight, sold-out ‘Eras Tour’ concerts at Wembley Stadium in London beginning on June 21",
                        "keywords": "",
                        "snippet": "Taylor Swift sold out Wembley Stadium eight times on her Eras Tour for both fans and celebrities alike.\n\nSwift, 34, kicked off her London residency on June 21, ...",
                        "url": "https://www.usmagazine.com/entertainment/pictures/taylor-swifts-london-eras-tour-concerts-every-celeb-guest/",
                        "image_url": "https://www.usmagazine.com/wp-content/uploads/2024/06/feature-Stars-at-Eras-in-London.jpg?crop=0px%2C656px%2C1440px%2C756px&resize=1200%2C630&quality=86&strip=all",
                        "language": "en",
                        "published_at": "2024-06-22T17:39:58.000000Z",
                        "source": "usmagazine.com",
                        "categories": [
                            "entertainment",
                            "general"
                        ],
                        "locale": "us"
                    }
                ]
            },
            {
                "uuid": "fb6af96b-8a7f-4aee-9f8e-c81ccc34d485",
                "title": "Tiffany Haddish Tells Us to ‘Ask Justin Timberlake’ About Sobriety",
                "description": "Tiffany Haddish told Us to ‘ask Justin Timberlake’ about sobriety when we spoke to the ‘Girls Trip’ actress ahead of the Hollywood Unlocked Impact Awards",
                "keywords": "",
                "snippet": "Tiffany Haddish is living her best, sober life and encouraged Us Weekly to “ask Justin Timberlake” about sobriety when we caught up with her at the Hollywoo...",
                "url": "https://www.usmagazine.com/celebrity-news/news/tiffany-haddish-tells-us-to-ask-justin-timberlake-about-sobriety/",
                "image_url": "https://www.usmagazine.com/wp-content/uploads/2024/06/Tiffany-Haddish-Tells-Us-to-Ask-Justin-Timberlake-About-Sobriety.jpg?crop=0px%2C18px%2C2000px%2C1050px&resize=1200%2C630&quality=86&strip=all",
                "language": "en",
                "published_at": "2024-06-22T18:22:18.000000Z",
                "source": "usmagazine.com",
                "categories": [
                    "entertainment",
                    "general"
                ],
                "locale": "us",
                "similar": [
                    {
                        "uuid": "a2e185b9-008f-4f79-ae9b-ce993acc517a",
                        "title": "Justin Timberlake Addresses His DWI Arrest at Chicago Concert",
                        "description": "Justin Timberlake returned to his ‘Forget Tomorrow World Tour’ on Friday, June 21, for the first time since his arrest for DWI days earlier",
                        "keywords": "",
                        "snippet": "Justin Timberlake resumed his Forget Tomorrow World Tour in Chicago on Friday, June 21, just days after his arrest for driving while intoxicated.\n\nThe singer, 4...",
                        "url": "https://www.usmagazine.com/celebrity-news/news/justin-timberlake-addresses-his-dwi-arrest-at-chicago-concert/",
                        "image_url": "https://www.usmagazine.com/wp-content/uploads/2024/06/Justin-Timberlake-Addresses-His-DWI-Arrest-During-Chicago-Concert.jpg?crop=0px%2C94px%2C2000px%2C1051px&resize=1200%2C630&quality=86&strip=all",
                        "language": "en",
                        "published_at": "2024-06-22T13:06:33.000000Z",
                        "source": "usmagazine.com",
                        "categories": [
                            "entertainment",
                            "general"
                        ],
                        "locale": "us"
                    },
                    {
                        "uuid": "76a6724d-4ba3-4cd0-9b55-6c949260f10b",
                        "title": "Justin Timberlake breaks silence on DWI arrest at Chicago concert",
                        "description": "Justin Timberlake acknowledged his Hamptons drunk driving arrest for the first time on Friday at his first appearance on stage since the Tuesday incident.",
                        "keywords": "",
                        "snippet": "Justin Timberlake publicly acknowledged his recent drunk-driving arrest for the first time at a Friday concert.\n\n\"It's been a tough week,\" the 10-time Grammy wi...",
                        "url": "https://www.foxnews.com/entertainment/justin-timberlake-breaks-silence-dwi-arrest-chicago-concert",
                        "image_url": "https://static.foxnews.com/foxnews.com/content/uploads/2024/06/justin-timberlake-dwi.jpg",
                        "language": "en",
                        "published_at": "2024-06-22T14:15:07.000000Z",
                        "source": "foxnews.com",
                        "categories": [
                            "general",
                            "politics"
                        ],
                        "locale": "us"
                    }
                ]
            }
        ],
        "business": ...,
        "sports": ...,
        "tech": ...,
        "science": ...,
        "health": ...
    }
}
            
        

Top Stories Available on: All plans

Endpoint

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

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

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

All text data returned is UTF-8.

All dates are in UTC (GMT).

HTTP GET Parameters

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

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

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

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

When using special characters (+, -, |, ", *, ()) you MUST URL-encode this parameter.
search_fields false Comma separated list of fields to apply the search parameter to.
Supported fields: title | description | keywords | main_text
Example: title,description,keywords
Default: title,main_text
locale false Comma separated list of country codes to include in the result set. Default is all countries. Click here for a list of supported countries.
Example: us,ca (US + Canada).
categories false Comma separated list of categories to include.
Supported categories: general | science | sports | business | health | entertainment | tech | politics | food | travel
Example: business,tech
exclude_categories false Comma separated list of categories to exclude.
domains false Comma separated list of domains to include. List of domains can be obtained through our Sources endpoint, found further down this page.
exclude_domains false Comma separated list of domains to exclude
source_ids false Comma separated list of source_ids to include. List of source_ids can be obtained through our Sources endpoint, found further down this page.
exclude_source_ids false Comma separated list of source_ids to exclude.
language false Comma separated list of languages to include. Default is all.
Click here for a list of supported languages.
Examples: en,es (English + Spanish)
published_before false Find all articles published before the specified date. Supported formats include: Y-m-d\TH:i:s | Y-m-d\TH:i | Y-m-d\TH | Y-m-d | Y-m | Y.
Examples: 2024-06-22T19:50:30 | 2024-06-22T19:50 | 2024-06-22T19 | 2024-06-22 | 2024-06 | 2024
published_after false Find all articles published after the specified date. Supported formats include: Y-m-d\TH:i:s | Y-m-d\TH:i | Y-m-d\TH | Y-m-d | Y-m | Y.
Examples: 2024-06-22T19:50:30 | 2024-06-22T19:50 | 2024-06-22T19 | 2024-06-22 | 2024-06 | 2024
published_on false Find all articles published on the specified date. Supported formats include: Y-m-d.
Examples: 2024-06-22
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": 1063496,
        "returned": 10,
        "limit": 10,
        "page": 1
    },
    "data": [
        {
            "uuid": "5030c5de-8563-4cce-b71b-6c9d52f06f36",
            "title": "Medical intern surprises would-be sexual abuser with hidden talent: 'Those lessons saved my life'",
            "description": "The male nurse who attempted to grope the intern - and do more, if she hadn't fought him off - had allegedly harassed a number of other female interns at the ho...",
            "keywords": "",
            "snippet": "[6355519722112]\n\nA medical intern in Thailand fought off a drunk nurse who tried to grope her one night, busting out fighting skills that helped her kick her wo...",
            "url": "https://www.foxnews.com/world/medical-intern-surprises-would-be-sexual-abuser-hidden-talent-those-lessons-saved-my-life",
            "image_url": "https://static.foxnews.com/foxnews.com/content/uploads/2024/06/thai-medical-intern.gif",
            "language": "en",
            "published_at": "2024-06-22T19:27:53.000000Z",
            "source": "foxnews.com",
            "categories": [
                "general",
                "politics"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "04c1cf31-6e6f-49b5-bef5-702c45726be9",
            "title": "Meagan Good, Jonathan Majors Have ‘Capacity’ For Marriage, Says Sister",
            "description": "La’Myia Good exclusively tells Us Weekly that sister Meagan Good and Jonathan Majors are ‘extremely happy’ and have the ‘capacity’ to get married",
            "keywords": "",
            "snippet": "La’Myia Good is happy for her sister, Meagan Good, and her romance with Jonathan Majors.\n\n“They’re both very, two very silly, deep-thinking, theatrical, b...",
            "url": "https://www.usmagazine.com/celebrity-news/news/meagan-good-jonathan-majors-have-capacity-for-marriage-says-sister/",
            "image_url": "https://www.usmagazine.com/wp-content/uploads/2024/06/Meaghan-Good-Jonathan-Majors-Absolutely-Have-Capacity-For-Marriage-Says-Sister-LaMyia-Good.jpg?crop=0px%2C0px%2C2000px%2C1051px&resize=1200%2C630&quality=86&strip=all",
            "language": "en",
            "published_at": "2024-06-22T19:15:49.000000Z",
            "source": "usmagazine.com",
            "categories": [
                "entertainment",
                "general"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "d46642d8-c346-4adb-9770-8824adf9b301",
            "title": "Euro 2024 Portugal game stopped by Cristiano Ronaldo fans",
            "description": "Portugal's Group F win against Turkey on Saturday was halted four times by supporters running onto the pitch for selfies with Cristiano Ronaldo.",
            "keywords": "",
            "snippet": "Open Extended Reactions\n\nCristiano Ronaldo was the centre of attention as Portugal beat Turkey at Euro 2024. Chris Brunskill/Fantasista/Getty Images\n\nPortugal's...",
            "url": "https://www.espn.com/soccer/story/_/id/40408409/euro-2024-portugal-game-stopped-cristiano-ronaldo-fans",
            "image_url": "https://a4.espncdn.com/combiner/i?img=%2Fphoto%2F2024%2F0622%2Fr1349086_1296x729_16%2D9.jpg",
            "language": "en",
            "published_at": "2024-06-22T19:07:50.000000Z",
            "source": "espn.com",
            "categories": [
                "sports",
                "general"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "0ca4e268-9b0c-44a2-882b-42b6eb483da1",
            "title": "Florida State gets Brady Smigiel, No. 6 pocket passer in '26",
            "description": "Four-star quarterback Brady Smigiel, the sixth-ranked pocket passer in the 2026 class and the No. 55 prospect in the ESPN Junior 300 is headed to Florida State.",
            "keywords": "",
            "snippet": "Open Extended Reactions\n\nFour-star quarterback Brady Smigiel, the sixth-ranked pocket passer in the 2026 class and the No. 55 prospect in the ESPN Junior 300, a...",
            "url": "https://www.espn.com/college-football/story/_/id/40408292/florida-state-gets-brady-smigiel-no-6-pocket-passer-26",
            "image_url": "https://a1.espncdn.com/combiner/i?img=%2Fphoto%2F2016%2F0502%2Fr79366_1296x729_16%2D9.jpg",
            "language": "en",
            "published_at": "2024-06-22T19:07:49.000000Z",
            "source": "espn.com",
            "categories": [
                "sports",
                "general"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "257fe767-5122-49af-b4dd-3afece563769",
            "title": "Caitlin Clark slows roll on championship expectations: 'Everybody just loves instant satisfaction'",
            "description": "The Indiana Fever have caught fire recently, winning five of their last six and each of their last four, but Caitlin Clark wants everyone to calm down just a dr...",
            "keywords": "",
            "snippet": "Despite the Indiana Fever getting the most popular women's basketball player maybe ever in the WNBA Draft, they were never going to be legitimate contenders.\n\nN...",
            "url": "https://www.foxnews.com/sports/caitlin-clark-slows-roll-championship-expectations-everybody-just-loves-instant-satisfaction",
            "image_url": "https://static.foxnews.com/foxnews.com/content/uploads/2024/06/caitlin-clark-clappin.jpg",
            "language": "en",
            "published_at": "2024-06-22T19:01:53.000000Z",
            "source": "foxnews.com",
            "categories": [
                "general",
                "politics"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "0e1e497f-d7f6-44da-a50f-7d7d0e6250db",
            "title": "Jason Kelce Holds Beer While Exchanging Friendship Bracelets at Eras Tour",
            "description": "Jason Kelce was spotted at London’s ‘Eras Tour’ concert showing off his sleeves of friendship bracelets, with some even dangling from his ears",
            "keywords": "",
            "snippet": "Jason Kelce went full Swiftie while attending Taylor Swift’s first Eras Tour concert at Wembley Stadium in London.\n\nJason, 36, showed off his collection of fr...",
            "url": "https://www.usmagazine.com/celebrity-news/news/jason-kelce-holds-beer-while-exchanging-friendship-bracelets-at-eras-tour/",
            "image_url": "https://www.usmagazine.com/wp-content/uploads/2024/06/Jason-Kelce-Expertly-Holds-Beer-While-Adjusting-Friendship-Bracelet-Sleeves-at-London-Eras-Tour.jpg?crop=0px%2C82px%2C1488px%2C781px&resize=1200%2C630&quality=86&strip=all",
            "language": "en",
            "published_at": "2024-06-22T19:00:30.000000Z",
            "source": "usmagazine.com",
            "categories": [
                "entertainment",
                "general"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "599e5493-ce57-4c4a-812b-3809811ceab5",
            "title": "A U.S. envoy visits Hanoi days after Putin, saying US-Vietnam trust is at ‘all-time high’",
            "description": "A senior U.S. diplomat has held talks in Vietnam and said that the trust between the two countries is at an “all-time high,” just days after Russian Preside...",
            "keywords": "Hanoi, Vietnam, Vietnam government, Vladimir Putin, United States government, Russia government, General news, United States, AP Top News, Washington news, Russia Ukraine war, i, World news, Diplomacy, Politics, Washington News",
            "snippet": "HANOI, Vietnam (AP) — A senior U.S. diplomat held talks in Vietnam on Saturday and said that the trust between the two countries was at an “all-time high,?...",
            "url": "https://apnews.com/article/vietnam-us-russia-kritenbrink-cc1873bee97218b50013bfdc3fdc5c10",
            "image_url": "https://dims.apnews.com/dims4/default/7dfd334/2147483647/strip/true/crop/3872x2178+0+202/resize/1440x810!/quality/90/?url=https%3A%2F%2Fassets.apnews.com%2F99%2Fc1%2F5dde391a0c6630736e79c95d2316%2F6cc77ee9fb004fb6bd6a7f07ce2069f6",
            "language": "en",
            "published_at": "2024-06-22T18:53:02.000000Z",
            "source": "apnews.com",
            "categories": [
                "general"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "9a48d867-b316-4c18-ab3e-ea65c744e4bf",
            "title": "AP report skewered for omitting men suspected of murdering Houston girl were illegal immigrants: ‘Shameless’",
            "description": "Social media users skewer Associated Press report for failing to mention that the two men suspected of murdering a Houston girl are illegal immigrants.",
            "keywords": "",
            "snippet": "Prominent social media users blasted the Associated Press for a report that failed to mention that the two men suspected of killing a 12-year-old Houston girl w...",
            "url": "https://www.foxnews.com/media/ap-report-skewered-omitting-men-suspected-murdering-houston-girl-were-illegal-immigrants-shameless",
            "image_url": "https://static.foxnews.com/foxnews.com/content/uploads/2024/06/Jocelyn-Nungaray-suspects.png",
            "language": "en",
            "published_at": "2024-06-22T18:47:44.000000Z",
            "source": "foxnews.com",
            "categories": [
                "general",
                "politics"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "245029ba-dfc4-41ab-8408-30defd6f0d3a",
            "title": "Rapper 50 Cent Allegedly Caught In Crypto Scam Defrauding Users Of $300 Million In Just 30 Minutes",
            "description": "The social media account X of renowned rapper 50 Cent was allegedly compromised, leading to a multimillion-dollar memecoin scam.",
            "keywords": "",
            "snippet": "Loading... Loading...\n\nThe social media account X of renowned rapper 50 Cent was allegedly compromised, leading to a multimillion-dollar memecoin scam, accordin...",
            "url": "https://www.benzinga.com/markets/cryptocurrency/24/06/39445624/rapper-50-cent-allegedly-caught-in-crypto-scam-defrauding-users-of-300-million-in-just-30-",
            "image_url": "https://cdn.benzinga.com/files/images/story/2024/06/22/Yerevan--Armenia--July-01-Curtis-Jackson.jpeg?width=1200&height=800&fit=crop",
            "language": "en",
            "published_at": "2024-06-22T18:41:00.000000Z",
            "source": "benzinga.com",
            "categories": [
                "business"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "2acf22ed-78df-4e97-aa31-3aa7528dc919",
            "title": "George Russell: Mercedes can fight for Spanish GP win",
            "description": "George Russell thinks Mercedes can challenge Lando Norris and Max Verstappen for victory at the Spanish Grand Prix.",
            "keywords": "",
            "snippet": "Open Extended Reactions\n\nBARCELONA, Spain - George Russell thinks Mercedes can challenge Lando Norris and Max Verstappen for victory at the Spanish Grand Prix.\n...",
            "url": "https://www.espn.com/f1/story/_/id/40408161/george-russell-mercedes-fight-spanish-gp-win",
            "image_url": "https://a4.espncdn.com/combiner/i?img=%2Fphoto%2F2024%2F0622%2Fr1349077_1296x729_16%2D9.jpg",
            "language": "en",
            "published_at": "2024-06-22T18:38:45.000000Z",
            "source": "espn.com",
            "categories": [
                "sports",
                "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: 2024-06-22T19:50:30 | 2024-06-22T19:50 | 2024-06-22T19 | 2024-06-22 | 2024-06 | 2024
published_after false Find all articles published after the specified date. Supported formats include: Y-m-d\TH:i:s | Y-m-d\TH:i | Y-m-d\TH | Y-m-d | Y-m | Y.
Examples: 2024-06-22T19:50:30 | 2024-06-22T19:50 | 2024-06-22T19 | 2024-06-22 | 2024-06 | 2024
published_on false Find all articles published on the specified date. Supported formats include: Y-m-d.
Examples: 2024-06-22
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": 50067436,
        "returned": 10,
        "limit": 10,
        "page": 1
    },
    "data": [
        {
            "uuid": "a24ae4a7-b201-492b-bd97-00e3d3d77a00",
            "title": "Szef marketingu Exim tours: przyszłość komunikacji biur podróży to personalizacja i automatyzacja",
            "description": "- Marka istnieje 30 lat, ale – przez dotychczasową strategię sprzedaży – jest mało znana. Mając tę świadomość, postawiliśmy na szczerość i prawd...",
            "keywords": "inne, marketing, reklama, wirtualnemedia.pl",
            "snippet": "Biuro podróży Exim tours wprowadziło w tym roku nową platformę komunikacji. Z Marcinem Tobiaszem, jego marketing managerem rozmawiamy o tym, jak konkurency...",
            "url": "https://www.wirtualnemedia.pl/artykul/marcin-tobiasz-przyszlosc-komunikacji-biur-podrozy-to-personalizacja-i-automatyzacja",
            "image_url": "https://static.wirtualnemedia.pl/media/new/top/66766cc3df116_marcintobiasz-eximtours.jpg",
            "language": "pl",
            "published_at": "2024-06-22T19:50:00.000000Z",
            "source": "wirtualnemedia.pl",
            "categories": [
                "tech"
            ],
            "relevance_score": null
        },
        {
            "uuid": "b2aedcd7-cd61-4f18-bd40-3f18ce727145",
            "title": "助推全民健身 2024“中华益动行”社区体育活动举行-中新网",
            "description": "",
            "keywords": "中华益动行, 赛事主办方, 让观众, 篮球比赛, 奥林匹克文化",
            "snippet": "中新网北京6月22日电 (记者 邢翀)在国际奥林匹克日即将到来之际,2024“中华益动行”社区体育活动(北京站)暨丰台区社区...",
            "url": "https://www.chinanews.com.cn/ty/2024/06-22/10238704.shtml",
            "image_url": "https://i2.chinanews.com.cn/simg/ypt/2024/240622/aef2b409-4b90-42b8-81fd-b58a2a58e2a9_zsite.jpg",
            "language": "zh",
            "published_at": "2024-06-22T19:49:51.000000Z",
            "source": "chinanews.com",
            "categories": [
                "general"
            ],
            "relevance_score": null
        },
        {
            "uuid": "88f53d19-032d-40ad-9fc0-16f7c94daeeb",
            "title": "Bellator Dublin Highlight Video: Shinobu Ota North-South Chokes Roger Blanque",
            "description": "Watch Shinobu Ota put away Roger Blanque with a slick north-south choke at Bellator Champions Series Dublin.",
            "keywords": "",
            "snippet": "NORTH-SOUTH CHOKE! 😳\n\n\n\nShinobu Ota stops Roger Blanque in the first round via submission!#BellatorDublin | LIVE NOW on MAX\n\n🌍 https://t.co/Dpuq4Xv6Jh pic...",
            "url": "https://www.sherdog.com/videos/highlightreels/Bellator-Dublin-Highlight-Video-Shinobu-Ota-NorthSouth-Chokes-Roger-Blanque-21634",
            "image_url": "https://www1-cdn.sherdog.com/_images/videos/20240622124947_highlight_640_384.PNG",
            "language": "en",
            "published_at": "2024-06-22T19:49:47.000000Z",
            "source": "sherdog.com",
            "categories": [
                "sports"
            ],
            "relevance_score": null
        },
        {
            "uuid": "2559417e-a2d2-4f1c-bfd4-a877f2a3295a",
            "title": "서울대병원 휴진중단 이어 의협 \"의정협의 참여\"",
            "description": "대한의사협회가 정부와 협의 의사가 있다는 데 의견을 모았다고 밝혔다.의협은 22일 열린 올바른 의료를 위한 특별위원?...",
            "keywords": "대한의사협회, 의정협의, 올특위, 의대정원",
            "snippet": "대한의사협회가 정부와 협의 의사가 있다는 데 의견을 모았다고 밝혔다.\n\n의협은 22일 열린 올바른 의료를 위한 특별위원...",
            "url": "http://www.medical-tribune.co.kr/news/articleView.html?idxno=205445",
            "image_url": "https://cdn.medical-tribune.co.kr/news/thumbnail/202406/205445_54980_4838_v150.jpg",
            "language": "ko",
            "published_at": "2024-06-22T19:49:31.000000Z",
            "source": "medical-tribune.co.kr",
            "categories": [
                "health"
            ],
            "relevance_score": null
        },
        {
            "uuid": "3846a5e8-3a25-4394-a33d-5ba4fb669198",
            "title": "张楚长篇小说《云落》海外版权推介会举办-中新网",
            "description": "",
            "keywords": "云落, 女性群像, 清明上河图, 张楚, 小人物",
            "snippet": "中新网北京6月22日电 (记者 高凯)“致敬在大时代的云层下勇毅前行的小人物——张楚长篇小说《云落》海外版权推介会”...",
            "url": "https://www.chinanews.com.cn/cul/2024/06-22/10238701.shtml",
            "image_url": "https://i2.chinanews.com.cn/simg/ypt/2024/240622/e3429c1c-5ff3-4d52-99d6-68ec33a7e3b7_zsite.jpeg",
            "language": "zh",
            "published_at": "2024-06-22T19:49:17.000000Z",
            "source": "chinanews.com",
            "categories": [
                "general"
            ],
            "relevance_score": null
        },
        {
            "uuid": "452bb39a-80b1-49cc-9144-b1834446e6e7",
            "title": "米多奇狂炫厚米烧雪饼香米饼30包 券后8.9元包邮",
            "description": "大米含量≥60%,芝士浓郁,玉米清甜,超有料超浓郁,狂炫一口酥脆,狂炫口味,快炫我嘴里!......",
            "keywords": "",
            "snippet": "注意:商品是限时、限量、限地区促销,下单时可能已变化,请您核对并理解。",
            "url": "http://www.kiees.com/2024/06/22/979313.html",
            "image_url": "",
            "language": "zh",
            "published_at": "2024-06-22T19:48:40.000000Z",
            "source": "kiees.com",
            "categories": [],
            "relevance_score": null
        },
        {
            "uuid": "dec6203c-9edf-4915-9b1c-c698b38b50c9",
            "title": "400余名美国师生沉浸式体验“锦绣江苏”-中新网",
            "description": "",
            "keywords": "中国式现代化, 师生, 江苏省教育厅, 沉浸式, 友谊地久天长",
            "snippet": "中新网南京6月22日电 (记者 徐珊珊)“我非常喜欢南京博物院,这里具有互动性,你可以自由探索,使用手机和音频进行导...",
            "url": "https://www.chinanews.com.cn/sh/2024/06-22/10238700.shtml",
            "image_url": "https://i2.chinanews.com.cn/simg/ypt/2024/240622/3e4ba849-4265-429f-b686-6f26b1353840_zsite.jpeg",
            "language": "zh",
            "published_at": "2024-06-22T19:48:37.000000Z",
            "source": "chinanews.com",
            "categories": [
                "general"
            ],
            "relevance_score": null
        },
        {
            "uuid": "5873e524-bee9-42da-ace5-ffed8aedaf5e",
            "title": "국힘 진종오, 한동훈 '러닝메이트'로 청년최고위원 출마",
            "description": "‘사격 황제’ 진종오(국민의힘 비례대표) 의원이 차기 당권에 도전하는 한동훈 전 비상대책위원장의 ‘러닝메이트’로...",
            "keywords": "진종오, 한동훈, 러닝메이트, 청년최고위원, 위원장",
            "snippet": "▲ 국민의힘 한동훈 비상대책위원장이 5일 오전 서울 여의도 당사에서 열린 인재영입식에게 '사격황제' 진종오 대한체육...",
            "url": "http://www.kado.net/news/articleView.html?idxno=1250821",
            "image_url": "https://cdn.kado.net/news/thumbnail/202406/1250821_688661_4510_v150.jpg",
            "language": "ko",
            "published_at": "2024-06-22T19:46:30.000000Z",
            "source": "kado.net",
            "categories": [],
            "relevance_score": null
        },
        {
            "uuid": "5dcd8d06-fde5-4613-9400-dedfd0cd4138",
            "title": "Euro 2024. Bernardo Silva garante seleção preparada para jogar os oitavos",
            "description": "Bernardo Silva, que aos 21 minutos fez o 1-0 frente à Turquia no jogo deste sábado, diz ter sentido que \"a seleção está melhor\" e \"num caminho bom, prepara...",
            "keywords": "RTP, Notícias, RTP Notícias",
            "snippet": "Bernardo Silva, que aos 21 minutos fez o 1-0 frente à Turquia no jogo deste sábado, diz ter sentido que \"a seleção está melhor\" e \"num caminho bom, prepara...",
            "url": "https://www.rtp.pt/noticias/desporto/euro-2024-bernardo-silva-garante-selecao-preparada-para-jogar-os-oitavos_v1581065",
            "image_url": "https://cdn-images.rtp.pt/icm/images/ca/ca615125080d2cda1172392f13664422_N.jpg",
            "language": "pt",
            "published_at": "2024-06-22T19:45:47.000000Z",
            "source": "rtp.pt",
            "categories": [
                "general"
            ],
            "relevance_score": null
        },
        {
            "uuid": "63c41a83-a77a-40a8-a08b-eb724c2cdfcc",
            "title": "O que fazer no fim de semana: a programação de São João em SP, RJ e mais",
            "description": "Principais notícias do mundo dos famosos, BBB, A Fazenda, cinema, séries, música e novelas na TV. Saiba as fofocas, casais e separações.",
            "keywords": "",
            "snippet": "Já estamos na reta final de junho, mas ainda dá tempo de curtir o São João! Confira a programação especial de Splash para a festa em diversas cidades pelo...",
            "url": "https://www.uol.com.br/splash/noticias/2024/06/22/programacao-fim-de-semana-sao-joao.htm",
            "image_url": "https://conteudo.imguol.com.br/c/entretenimento/a4/2024/06/10/sao-joao-de-nois-tudim-1718046907403_v2_615x300.jpg",
            "language": "pt",
            "published_at": "2024-06-22T19:45:25.000000Z",
            "source": "uol.com.br",
            "categories": [
                "general"
            ],
            "relevance_score": null
        }
    ]
}
            
        

Similar News Available on: All plans

Endpoint

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

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

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

All text data returned is UTF-8.

All dates are in UTC (GMT).

HTTP GET Parameters

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

Response Objects

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

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

Example Request

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

Example Response

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

News by UUID Available on: All plans

Endpoint

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

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

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

All text data returned is UTF-8.

All dates are in UTC (GMT).

HTTP GET Parameters

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

Response Objects

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

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

Example Request

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

Example Response

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

Sources Available on: All plans

Endpoint

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

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

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

All text data returned is UTF-8.

HTTP GET Parameters

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

Response Objects

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

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

Example Request

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

Example Response

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

Errors

Errors

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

Errors

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

Example Error Response

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

Examples

API Examples

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

Example Request 1

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

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

Example Request 2

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

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

Example Request 3

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

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

Example Request 4

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

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

Example Request 5

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

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

Example Request 6

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

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

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.