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: 2026-10-15
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": "74698143-1b91-4d1e-a131-1fea6ff0f6cc",
                "title": "Trump touts booming economy at Montana rally, but supporters feel the pinch",
                "description": "KALISPELL, Mont. — On a day when the U.S. inflation rate was shown to have climbed 3.7% over the past year, President Donald Trump said at a rally in Montana on Wednesday, “We have very little inflation.”",
                "keywords": "",
                "snippet": "KALISPELL, Mont. — On a day when the U.S. inflation rate was shown to have climbed 3.7% over the past year, President Donald Trump said at a rally in Montana ...",
                "url": "https://www.nbcnews.com/politics/donald-trump/trump-touts-booming-economy-montana-rally-supporters-feel-pinch-rcna603000",
                "image_url": "https://media-cldnry.s-nbcnews.com/image/upload/t_nbcnews-fp-1200-630,f_auto,q_auto:best/rockcms/2026-10/261014-trump-montana-vsb-2157-f2e9d9.jpg",
                "language": "en",
                "published_at": "2026-10-15T05:20:34.000000Z",
                "source": "nbcnews.com",
                "categories": [
                    "general",
                    "politics"
                ],
                "locale": "us",
                "similar": [
                    {
                        "uuid": "9854e11f-64e9-40ce-8ec8-4b8daeb0ee6d",
                        "title": "Trump says \"leakers should be shot\" during Arizona rally",
                        "description": "President Trump told supporters at an Arizona rally on Wednesday that he thinks",
                        "keywords": "Arizona, Donald Trump",
                        "snippet": "Trump says \"leakers should be shot\" President Trump told supporters at an Arizona rally on Wednesday that he thinks \"leakers should be shot.\" CBS News' Natalie ...",
                        "url": "https://www.cbsnews.com/video/trump-rallies-in-arizona-and-montana-with-midterms-20-days-away/",
                        "image_url": "https://assets3.cbsnewsstatic.com/hub/i/r/2026/10/14/5289b8b4-0767-47fc-9af3-d59951242a1e/thumbnail/1200x630/d46bb353a061440897ee5476d3533121/cbsn-fusion-trump-rallies-in-arizona-and-montana-with-midterms-20-days-away-thumbnail.jpg",
                        "language": "en",
                        "published_at": "2026-10-14T23:06:00.000000Z",
                        "source": "cbsnews.com",
                        "categories": [
                            "general",
                            "politics"
                        ],
                        "locale": "us"
                    },
                    {
                        "uuid": "c990c31f-53f8-436f-95f2-aa06a2da60de",
                        "title": "Trump announces new Defense Department 'super range' for Montana",
                        "description": "During a rally in Montana, President Trump announced that the state will receive a new Defense Department 'super range' for testing advanced weapons and technologies.",
                        "keywords": "",
                        "snippet": "During a rally in Montana, President Trump announced that the state will receive a new Defense Department 'super range' for testing advanced weapons and technol...",
                        "url": "https://www.nbcnews.com/video/trump-announces-new-defense-department-super-range-for-montana-271605829612",
                        "image_url": "https://media-cldnry.s-nbcnews.com/image/upload/t_nbcnews-fp-1200-630,f_auto,q_auto:best/mpx/2704722219/2026_10/1792032416131_f_mo_la_new_weapons_montana_261014_S3_1920x1080-eaqrvd.jpg",
                        "language": "en",
                        "published_at": "2026-10-15T02:47:01.000000Z",
                        "source": "nbcnews.com",
                        "categories": [
                            "politics",
                            "general"
                        ],
                        "locale": "us"
                    }
                ]
            },
            {
                "uuid": "c09b1ffb-913e-4a10-aaf9-a01e0960f97f",
                "title": "Kate Gosselin Shares Cryptic Message After Son Collin Gosselin’s Tell-All Book Release",
                "description": "Kate Gosselin spoke out after her 22-year-old estranged son Collin Gosselin released tell-all memoir In the Shadow of Eight, in which he accused the former Jon & Kate Plus 8 star of child abuse.",
                "keywords": "",
                "snippet": "Watch : All of Collin Gosselin's Abuse Claims About Mom Kate Gosselin\n\nWarning: This article contains allegations of child abuse.\n\nKate Gosselin is not keeping ...",
                "url": "https://www.eonline.com/news/1437091/kate-gosselin-makes-cryptic-comment-on-son-collins-book-abuse-claims?cmpid=rss-syndicate-genericrss-us-top_stories",
                "image_url": "https://akns-images.eonline.com/eol_images/Entire_Site/20261014/1a7345db-2046-4e7e-af15-0b29862134eb_1792006866.jpg?fit=around%7C1200:1200&output-quality=90&crop=1200:1200;center,top",
                "language": "en",
                "published_at": "2026-10-14T20:43:51.000000Z",
                "source": "eonline.com",
                "categories": [
                    "entertainment",
                    "general"
                ],
                "locale": "us",
                "similar": [
                    {
                        "uuid": "d618a422-45fe-4717-8a1f-ac23f43518a1",
                        "title": "Collin Gosselin Recalls His Happiest Memories With Mom Kate",
                        "description": "Collin Gosselin is looking back at his childhood with his mom, Kate Gosselin, in his new memoir",
                        "keywords": "",
                        "snippet": "Collin Gosselin is looking back at his childhood with his mom, Kate Gosselin, in his new memoir.\n\n“The happiest memories I have with my mom are little moments...",
                        "url": "https://www.usmagazine.com/celebrity-news/news/collin-gosselin-recalls-his-happiest-memories-with-mom-kate/",
                        "image_url": "https://www.usmagazine.com/wp-content/uploads/2026/10/Collin-Gosselin-Claims-His-Happiest-Memories-With-Mom-Kate-Were-Fabricated-for-Jon-and-Kate-Plus-8.jpg?crop=0px%2C41px%2C2000px%2C1051px&resize=1200%2C630&quality=40&strip=all",
                        "language": "en",
                        "published_at": "2026-10-14T20:43:11.000000Z",
                        "source": "usmagazine.com",
                        "categories": [
                            "entertainment",
                            "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: 2026-10-15T08:34:39 | 2026-10-15T08:34 | 2026-10-15T08 | 2026-10-15 | 2026-10 | 2026
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: 2026-10-15T08:34:39 | 2026-10-15T08:34 | 2026-10-15T08 | 2026-10-15 | 2026-10 | 2026
published_on false Find all articles published on the specified date. Supported formats include: Y-m-d.
Examples: 2026-10-15
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": 1721457,
        "returned": 10,
        "limit": 10,
        "page": 1
    },
    "data": [
        {
            "uuid": "0e1af456-d9cf-47cc-bb9c-9e23e4415fda",
            "title": "Selena Gomez Reveals the ‘Sweet’ Way She and Benny Blanco Celebrated Their 1st Wedding Anniversary",
            "description": "Selena Gomez revealed how she and husband Benny Blanco celebrated their first wedding anniversary in a 'sweet' way",
            "keywords": "",
            "snippet": "Selena Gomez and Benny Blanco’s marriage is in full bloom.\n\nThe Only Murders in the Building actress, 34, and the music producer, 38, celebrated their one-yea...",
            "url": "https://www.usmagazine.com/celebrity-news/news/selena-gomez-benny-blancos-sweet-1st-wedding-anniversary/",
            "image_url": "https://www.usmagazine.com/wp-content/uploads/2026/10/Selena-Gomez-Reveals-Sweet-Way-She-Celebrated-1st-Wedding-Anniversary.jpg?crop=328px%2C330px%2C696px%2C366px&resize=1200%2C630&quality=86&strip=all",
            "language": "en",
            "published_at": "2026-10-15T08:21:26.000000Z",
            "source": "usmagazine.com",
            "categories": [
                "entertainment",
                "general"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "3606a7ce-80d2-4940-aa3d-fe84ece58fd7",
            "title": "Pope Leo 'slept well' as his recovery continues, Vatican says",
            "description": "The pontiff was diagnosed with lung cancer and underwent surgery this week.",
            "keywords": "",
            "snippet": "The pontiff was diagnosed with lung cancer and underwent surgery this week.\n\nPope Leo 'slept well' as his recovery continues, Vatican says\n\nPeople pray at the s...",
            "url": "https://abcnews.com/International/pope-leo-slept-recovery-continues-vatican/story?id=137278462",
            "image_url": "https://i.abcnewsfe.com/a/d0408850-7689-4f8a-8e95-cf28de45ca28/hospital-main_1792047838583_hpMain_16x9.jpg?w=1600",
            "language": "en",
            "published_at": "2026-10-15T07:36:34.000000Z",
            "source": "abcnews.go.com",
            "categories": [
                "general"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "5fb17069-7795-42bb-a28c-b45971ea1e95",
            "title": "Cornell president pressed by angry faculty members frustrated by his handling of gang rape case",
            "description": "Cornell President Michael Kotlikoff defended his leadership to faculty debating a no-confidence vote over his handling of a campus rape case.",
            "keywords": "US News, cornell 7, cornell university, lawsuits, rape",
            "snippet": "Cornell University President Michael Kotlikoff faced angry members of the school’s faculty Wednesday at a meeting that underscored deep frustration over his a...",
            "url": "https://nypost.com/2026/10/15/us-news/cornell-president-pressed-by-angry-faculty-members-frustrated-by-his-handling-of-gang-rape-case/",
            "image_url": "https://nypost.com/wp-content/uploads/sites/2/2026/10/145106337.jpg?quality=75&strip=all&w=1200",
            "language": "en",
            "published_at": "2026-10-15T07:36:00.000000Z",
            "source": "nypost.com",
            "categories": [
                "general"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "3b785465-91f0-468b-b5d3-e2ff4f904b16",
            "title": "Teen accused of plotting mass shooting at Chicago-area Hindu temple",
            "description": "Police in a Chicago suburb say they have thwarted a potential mass shooting at a Hindu place of worship",
            "keywords": "Terrorism, Indictments, General news, Law enforcement, Teens, Crime, Shootings, Religion, Race and ethnicity, U.S. news",
            "snippet": "Police in a Chicago suburb say they have thwarted a potential mass shooting at a Hindu place of worship\n\nPALATINE, Ill. -- Police in a Chicago suburb announced ...",
            "url": "https://abcnews.com/US/wireStory/teen-accused-plotting-mass-shooting-chicago-area-hindu-137275418",
            "image_url": "https://s.abcnews.com/images/US/abc_news_default_2000x2000_update_16x9_992.jpg",
            "language": "en",
            "published_at": "2026-10-15T07:30:13.000000Z",
            "source": "abcnews.go.com",
            "categories": [
                "general",
                "politics"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "0440a957-5d0c-406d-b0e6-0cbdd0bf71b7",
            "title": "Ukrainian drone attack causes fire at Russian oil refinery – governor",
            "description": "A fire has broken out at an oil refinery in Russia’s Ryazan Region as a result of a Ukrainian drone attack, local governor Pavel Malkov has said",
            "keywords": "",
            "snippet": "Ryazan Region was inundated by Kiev’s UAVs overnight, Pavel Malkov has said\n\nA blaze has broken out at an oil refinery in Russia’s Ryazan Region as a result...",
            "url": "https://rt-english.com/russia/647222-ukrainian-drone-attack-causes-fire/",
            "image_url": "https://mf.b37mrtl.ru/files/static.en/article/breaking.jpg",
            "language": "en",
            "published_at": "2026-10-15T07:07:51.000000Z",
            "source": "rt.com",
            "categories": [
                "general",
                "politics"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "624dc154-c1b3-4c5c-9721-ed0046df4aae",
            "title": "El Salvador's Bukele announces plan to free up to half of prisoners jailed in gang crackdown",
            "description": "El Salvador President Nayib Bukele unveiled a plan to release up to half of the inmates arrested under a state of emergency during a crackdown on MS-13 and Barr...",
            "keywords": "world, human rights, ms 13, latin america, latino, central america",
            "snippet": "NEW You can now listen to Fox News articles!\n\nSalvadoran President Nayib Bukele has unveiled a plan that could allow the conditional early release of up to half...",
            "url": "https://www.foxnews.com/world/el-salvador-bukele-announces-plan-free-half-prisoners-jailed-gang-crackdown",
            "image_url": "https://static.foxnews.com/foxnews.com/content/uploads/2026/02/bukele.jpg",
            "language": "en",
            "published_at": "2026-10-15T07:01:59.000000Z",
            "source": "foxnews.com",
            "categories": [
                "general",
                "politics"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "8e4e372c-3e54-4571-9c5a-d92d3860574b",
            "title": "'The Diplomat' Season 4: Who Dies & Who Is New Prime Minister?",
            "description": "There have been three British Prime Ministers and five Foreign Secretaries since The Diplomat premiered in April 2023.",
            "keywords": "",
            "snippet": "SPOILER ALERT: This post contains spoilers for The Diplomat Season 4, now streaming on Netflix.\n\nThere have been three British Prime Ministers and five Foreign ...",
            "url": "https://deadline.com/2026/10/the-diplomat-season-4-death-prime-minister-change-explained-1237153276/",
            "image_url": "https://deadline.com/wp-content/uploads/2026/10/en-gb__DIPLOMAT_S4_main_key_art_main_key_art_4_x_5_v_1080px1350p_rgb_predate_1-1500.jpg?w=1024",
            "language": "en",
            "published_at": "2026-10-15T07:01:00.000000Z",
            "source": "deadline.com",
            "categories": [
                "entertainment"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "0b3f82a6-20b3-4927-a4d5-3a00b1100493",
            "title": "Copper theft suspect’s desperate escape caught on bodycam video before deputies discover what he left behind",
            "description": "Oklahoma copper theft suspect Rayven Lee Wooten escaped deputies by diving through a window, but left his driver's license behind.",
            "keywords": "US News, crime, oklahoma, police body cameras, theft",
            "snippet": "An Oklahoma copper theft suspect stunned a deputy with a headfirst dive through a closed window, but overlooked one detail that helped deputies track him down.\n...",
            "url": "https://nypost.com/2026/10/15/us-news/copper-theft-suspects-desperate-escape-caught-on-bodycam-video-before-deputies-discover-what-he-left-behind/",
            "image_url": "https://nypost.com/wp-content/uploads/sites/2/2026/10/copper-theft-suspects-desperate-escape-145105465.jpg?quality=75&strip=all&w=1200",
            "language": "en",
            "published_at": "2026-10-15T06:53:39.000000Z",
            "source": "nypost.com",
            "categories": [
                "general"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "cefa48a3-4eae-4ecf-b429-b7e2c26481de",
            "title": "Ex-Venezuelan President Maduro returning to federal court to face torture allegations",
            "description": "Ex-Venezuelan President Nicolás Maduro returns Thursday to a New York courtroom to answer a rewritten drug trafficking indictment",
            "keywords": "Indictments, General news, Courts, Torture, U.S. news",
            "snippet": "FILE - Venezuelan President Nicolas Maduro and his wife Cilia Flores wave after his swearing-in ceremony for a third term at the National Assembly in Caracas, V...",
            "url": "https://abcnews.com/US/wireStory/venezuelan-president-nicols-maduro-returning-federal-court-face-137277780",
            "image_url": "https://i.abcnewsfe.com/a/8aadbdde-0b1d-439d-ad42-d3d668c2b934/wirestory_ca502461c39b94de9c663d441cbf5c63_16x9.jpg?w=1600",
            "language": "en",
            "published_at": "2026-10-15T06:53:12.000000Z",
            "source": "abcnews.go.com",
            "categories": [
                "general",
                "politics"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "e7aea780-9ef5-481e-af79-7a9c3fdf0401",
            "title": "Hot weather and winds raise California wildfire threat as power shutoffs start",
            "description": "California is bracing for fire weather, with thousands potentially losing power as utilities aim to prevent wildfires during hot and windy conditions",
            "keywords": "Utilities, Fires, General news, Heat waves, Wildfires, Weather, Climate and environment, U.S. news",
            "snippet": "California is bracing for fire weather, with thousands potentially losing power as utilities aim to prevent wildfires during hot and windy conditions\n\nFILE - Fl...",
            "url": "https://abcnews.com/US/wireStory/hot-weather-winds-raise-california-wildfire-threat-power-137278020",
            "image_url": "https://i.abcnewsfe.com/a/ac8f4e30-1085-481a-ae2b-ee31b36adc4d/wirestory_fd66cf644992f80d95b8bae044829392_16x9.jpg?w=1600",
            "language": "en",
            "published_at": "2026-10-15T06:52:08.000000Z",
            "source": "abcnews.go.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: 2026-10-15T08:34:39 | 2026-10-15T08:34 | 2026-10-15T08 | 2026-10-15 | 2026-10 | 2026
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: 2026-10-15T08:34:39 | 2026-10-15T08:34 | 2026-10-15T08 | 2026-10-15 | 2026-10 | 2026
published_on false Find all articles published on the specified date. Supported formats include: Y-m-d.
Examples: 2026-10-15
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": 54709864,
        "returned": 10,
        "limit": 10,
        "page": 1
    },
    "data": [
        {
            "uuid": "23148c1e-a175-4695-898b-a9b70363d733",
            "title": "中 휴머노이드 로봇 기업 애지봇, 홍콩 IPO '연기'…왜?",
            "description": "[초이스경제 홍인표 기자] 중국 휴머노이드 로봇 산업이 빠르게 성장하는 가운데 주요 기업들이 기업공개(IPO)를 통한 자?...",
            "keywords": "",
            "snippet": "산업 현장에 투입된 중국 휴머노이드 로봇. /사진=중국 애지봇 소셜미디어 공식계정 캡처\n\n[초이스경제 홍인표 기자] 중?...",
            "url": "http://www.choicenews.co.kr/news/articleView.html?idxno=172229",
            "image_url": "https://cdn.choicenews.co.kr/news/thumbnail/202610/172229_131943_2017_v150.jpg",
            "language": "ko",
            "published_at": "2026-10-15T08:34:20.000000Z",
            "source": "choicenews.co.kr",
            "categories": [],
            "relevance_score": null
        },
        {
            "uuid": "ab02e9b0-7bda-4a29-9115-1b9858206d4e",
            "title": "155款App明确拒接豆包手机助手背后:改变互联网平台长期建立流量和广告商业模式",
            "description": "155款App明确拒接豆包手机助手背后:改变互联网平台长期建立流量和广告商业模式",
            "keywords": ", 155款App明确拒接豆包手机助手背后:改变互联网平台长期建立流量和广告商业模式, 快科技",
            "snippet": "155款App明确拒接豆包手机助手背后:改变互联网平台长期建立流量和广告商业模式\n\n快科技10月15日消息,豆包手机想要实?...",
            "url": "https://news.mydrivers.com/1/1157/1157558.htm",
            "image_url": "https://img1.mydrivers.com/img/20261015/6dff97468f2d4c0d88ec21bec3d73e3a.png",
            "language": "zh",
            "published_at": "2026-10-15T08:34:01.000000Z",
            "source": "news.mydrivers.com",
            "categories": [
                "tech",
                "general"
            ],
            "relevance_score": null
        },
        {
            "uuid": "c4ae3043-47d7-4eee-a859-cf7d4f646162",
            "title": "야단-떠들거나 소란 일으키거나",
            "description": "[의약뉴스]야단은 한자어 '惹端'에서 왔다.순우리말로 착각하기 쉬우나 그렇지 않다.명사 야단은 어떤 일로 시끄럽게 떠?...",
            "keywords": "",
            "snippet": "[의약뉴스]\n\n▲ 술에 취해 야단을 떠는 사람에게는 찬물을 느닷없이 끼얹는 것이 효과적일 때가 있다.\n\n야단은 한자어 '惹...",
            "url": "http://www.newsmp.com/news/articleView.html?idxno=258682",
            "image_url": "http://www.newsmp.com/news/thumbnail/202610/258682_298076_3921_v150.jpg",
            "language": "ko",
            "published_at": "2026-10-15T08:33:33.000000Z",
            "source": "newsmp.com",
            "categories": [],
            "relevance_score": null
        },
        {
            "uuid": "3cf55c3a-b80f-4399-94ba-becdba01a455",
            "title": "구리시 안전보안관협의회, 코스모스 축제서 안전문화 홍보 - 신아일보",
            "description": "경기 구리시 안전보안관협의회가 지역 대표 축제 현장에서 시민들의 안전의식을 높이고 생활 속 안전문화 확산을 위한 ?...",
            "keywords": "",
            "snippet": "[사진=구리시]\n\n경기 구리시 안전보안관협의회가 지역 대표 축제 현장에서 시민들의 안전의식을 높이고 생활 속 안전문?...",
            "url": "https://www.shinailbo.co.kr/news/articleView.html?idxno=5071928",
            "image_url": "https://cdn.shinailbo.co.kr/news/photo/202610/5071928_2069587_5357.jpg",
            "language": "ko",
            "published_at": "2026-10-15T08:33:21.000000Z",
            "source": "shinailbo.co.kr",
            "categories": [],
            "relevance_score": null
        },
        {
            "uuid": "50962432-0339-4f97-ade5-4ef4cc928acc",
            "title": "주한미군사령관 \"전작권 전환 찬성하지만 조건 변화…새 기준 생겨\" - 신아일보",
            "description": "제이비어 브런슨 주한미군사령관이 전시작전통제권(전작권) 전환에 원칙적으로 찬성하면서도 안보 환경 변화에 따른 조...",
            "keywords": "",
            "snippet": "제이비어 브런슨 주한미군사령관 [사진=연합뉴스]\n\n제이비어 브런슨 주한미군사령관이 전시작전통제권(전작권) 전환에 ?...",
            "url": "https://www.shinailbo.co.kr/news/articleView.html?idxno=5071952",
            "image_url": "https://cdn.shinailbo.co.kr/news/photo/202610/5071952_2069624_3151.jpg",
            "language": "ko",
            "published_at": "2026-10-15T08:32:49.000000Z",
            "source": "shinailbo.co.kr",
            "categories": [],
            "relevance_score": null
        },
        {
            "uuid": "b63d970a-afe0-45ee-aeb3-7760d9a338fc",
            "title": "1156마력 압도적 성능... 포르쉐, 순수 전기 SUV '카이엔 쿠페 일렉트릭' 상륙",
            "description": "[오토헤럴드 김흥식 기자] 포르쉐가 브랜드 대표 SUV의 전동화 버전인 카이엔 쿠페 일렉트릭을 국내 시장에 공식 출시하?...",
            "keywords": "포르쉐, 카이엔",
            "snippet": "카이엔 터보 쿠페 일렉트릭. (포르쉐 코리아)\n\n[오토헤럴드 김흥식 기자] 포르쉐가 브랜드 대표 SUV의 전동화 버전인 카이?...",
            "url": "http://www.autoherald.co.kr/news/articleView.html?idxno=61891",
            "image_url": "https://cdn.autoherald.co.kr/news/thumbnail/202610/61891_119364_3052_v150.jpg",
            "language": "ko",
            "published_at": "2026-10-15T08:32:38.000000Z",
            "source": "autoherald.co.kr",
            "categories": [],
            "relevance_score": null
        },
        {
            "uuid": "391fedb6-a717-44c4-b6fa-75622b424a2a",
            "title": "중구문화재단·전주관광재단, 문화예술·관광 활성화 위한 업무협약 체결",
            "description": "[한국증권신문_ 조나단 기자] 서울 중구문화재단과 전주관광재단이 문화예술 및 관광 분야의 교류 확대와 공익사업 활성...",
            "keywords": "",
            "snippet": "공연예술·축제 교류 및 공익사업 협력…31일 전주서 첫 공동 음악회 개최\n\n지난 13일 충무아트센터에서 열린 중구문화재?...",
            "url": "http://www.ksdaily.co.kr/news/articleView.html?idxno=111126",
            "image_url": "http://www.ksdaily.co.kr/news/thumbnail/202610/111126_68478_3211_v150.jpg",
            "language": "ko",
            "published_at": "2026-10-15T08:32:26.000000Z",
            "source": "ksdaily.co.kr",
            "categories": [],
            "relevance_score": null
        },
        {
            "uuid": "05a56b93-3722-4bb1-a556-ed9c1d058ef3",
            "title": "\"고작 1년 쓰자고 만드나\"…보험사 배타적사용권 신청 급감 < 정책/금융 < 기사본문",
            "description": "보험사들이 새로운 보장으로 소비자 혜택을 더 늘릴 수 있도록 하는 배타적사용권이 올해 신청 건수가 전년보다 크게 줄...",
            "keywords": "",
            "snippet": "(서울=연합인포맥스) 이수용 기자 = 보험사들이 새로운 보장으로 소비자 혜택을 더 늘릴 수 있도록 하는 배타적사용권이 ...",
            "url": "https://news.einfomax.co.kr/news/articleView.html?idxno=4439314",
            "image_url": "https://cdn.news.einfomax.co.kr/news/thumbnail/202610/4439314_349430_323_v150.jpg",
            "language": "ko",
            "published_at": "2026-10-15T08:31:47.000000Z",
            "source": "t240.ndsoftnews.com",
            "categories": [],
            "relevance_score": null
        },
        {
            "uuid": "b9025bc1-e29c-4664-93fb-0dbc6516d847",
            "title": "남양주시, 다산기념관 새 단장…전시실 개편 마치고 재개관 - 신아일보",
            "description": "경기 남양주시가 다산 정약용 선생의 삶과 사상을 보다 생생하게 전달하기 위해 다산기념관의 전시시설을 새롭게 단장?...",
            "keywords": "",
            "snippet": "[사진=남양주시]\n\n경기 남양주시가 다산 정약용 선생의 삶과 사상을 보다 생생하게 전달하기 위해 다산기념관의 전시시?...",
            "url": "https://www.shinailbo.co.kr/news/articleView.html?idxno=5071926",
            "image_url": "https://cdn.shinailbo.co.kr/news/photo/202610/5071926_2069585_4256.jpg",
            "language": "ko",
            "published_at": "2026-10-15T08:31:28.000000Z",
            "source": "shinailbo.co.kr",
            "categories": [],
            "relevance_score": null
        },
        {
            "uuid": "b3d93087-cc57-49ff-9ea6-a5568ec1a910",
            "title": "SKT, AI-RAN으로 일반 차량 무인 이송 구현…글로벌 5G 혁신상 수상",
            "description": "SK텔레콤(SKT)이 인공지능(AI)과 통신망을 결합한 차세대 네트워크 기술로 일반 차량의 무인 이송을 구현해 글로벌 통신 기...",
            "keywords": "",
            "snippet": "(왼쪽부터)나민수 SKT Biz Tech팀 매니저, 신홍석 유선 Tech팀 매니저(사진:SKT)\n\nSK텔레콤(SKT)이 인공지능(AI)과 통신망을 결합?...",
            "url": "https://www.aitimes.kr/news/articleView.html?idxno=42306",
            "image_url": "https://cdn.aitimes.kr/news/thumbnail/202610/42306_63607_3029_v150.jpg",
            "language": "ko",
            "published_at": "2026-10-15T08:31:27.000000Z",
            "source": "aitimes.kr",
            "categories": [
                "tech"
            ],
            "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: 2026-10-15T08:34:39 | 2026-10-15T08:34 | 2026-10-15T08 | 2026-10-15 | 2026-10 | 2026
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: 2026-10-15T08:34:39 | 2026-10-15T08:34 | 2026-10-15T08 | 2026-10-15 | 2026-10 | 2026
published_on false Find all articles published on the specified date. Supported formats include: Y-m-d.
Examples: 2026-10-15
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=2026-10-08
    

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