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: 2025-12-13
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": "fca71c2a-7ef9-42b8-852a-7b7f4333d27a",
                "title": "Peter Greene, actor known for 'Pulp Fiction' and 'The Mask,' dead at 60",
                "description": "Peter Greene, the actor known for playing villains and criminals, including in his role as Zed in \"Pulp Fiction,\" died at his New York City home Friday, his manager confirmed.",
                "keywords": "",
                "snippet": "Peter Greene, the actor known for playing villains and criminals, including in his role as Zed in \"Pulp Fiction,\" died at his New York City home Friday, his man...",
                "url": "https://www.nbcnews.com/news/obituaries/peter-greene-actor-known-pulp-fiction-mask-dead-60-rcna248976",
                "image_url": "https://media-cldnry.s-nbcnews.com/image/upload/t_nbcnews-fp-1200-630,f_auto,q_auto:best/rockcms/2025-12/251212-Peter-Greene-aa-1206-f18dd2.jpg",
                "language": "en",
                "published_at": "2025-12-13T05:20:27.000000Z",
                "source": "nbcnews.com",
                "categories": [
                    "general",
                    "politics"
                ],
                "locale": "us",
                "similar": [
                    {
                        "uuid": "5659463f-d97f-4ddb-b27b-26abc521c084",
                        "title": "‘Pulp Fiction,’ ‘The Mask’ actor Peter Greene found dead at 60 inside his NYC apartment",
                        "description": "Actor Peter Greene,  best known for his roles in “The Mask” and “Pulp Fiction,” was found dead inside his Lower East Side apartment Friday afternoon, his longtime manager confirmed to The Post.",
                        "keywords": "Metro, US News, Entertainment, actors, apartments, celebrity deaths, deaths, nyc, obituaries",
                        "snippet": "Actor Peter Greene, best known for his roles in “The Mask” and “Pulp Fiction,” was found dead inside his Lower East Side apartment Friday afternoon, his...",
                        "url": "https://nypost.com/2025/12/12/us-news/peter-greene-pulp-fiction-and-the-mask-actor-found-dead-at-60-inside-his-nyc-apartment/",
                        "image_url": "https://nypost.com/wp-content/uploads/sites/2/2025/12/newspress-collage-i4w16nx3b-1765601683378.jpg?quality=75&strip=all&1765583714&w=1200",
                        "language": "en",
                        "published_at": "2025-12-13T04:58:26.000000Z",
                        "source": "nypost.com",
                        "categories": [
                            "general"
                        ],
                        "locale": "us"
                    }
                ]
            },
            {
                "uuid": "beee8dbc-fba6-4773-aa89-4f0d9a530980",
                "title": "Democrats tout projects funded by a bill they voted against",
                "description": "Democrats voted against federal funding to end the shutdown and then touted the money delivered home to their districts.",
                "keywords": "",
                "snippet": "WASHINGTON — For years, Democrats railed against Republicans who voted against government spending bills and then touted the money delivered home to their dis...",
                "url": "https://www.nbcnews.com/politics/congress/democrats-tout-projects-government-shutdown-funding-bill-opposed-rcna248441",
                "image_url": "https://media-cldnry.s-nbcnews.com/image/upload/t_nbcnews-fp-1200-630,f_auto,q_auto:best/rockcms/2025-12/251212-Riley-Gillen-split-gk-58b668.jpg",
                "language": "en",
                "published_at": "2025-12-13T10:00:00.000000Z",
                "source": "nbcnews.com",
                "categories": [
                    "politics",
                    "general"
                ],
                "locale": "us",
                "similar": [
                    {
                        "uuid": "6601e053-7cad-4822-b462-edfe2b16aaa3",
                        "title": "Democrats release new photos from Epstein estate",
                        "description": "US Democrats have released a new batch of photos from Jeffrey Epstein’s estate",
                        "keywords": "",
                        "snippet": "Some of the images depict President Donald Trump and conservative strategist Steve Bannon\n\nUS House Democrats released around 100 new photos obtained from the e...",
                        "url": "https://www.rt.com/news/629406-new-epstein-photos-released/",
                        "image_url": "https://mf.b37mrtl.ru/files/2025.12/article/693cca8e2030271b2e3ce2d6.JPG",
                        "language": "en",
                        "published_at": "2025-12-13T02:08:30.000000Z",
                        "source": "rt.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: 2025-12-13T13:26:53 | 2025-12-13T13:26 | 2025-12-13T13 | 2025-12-13 | 2025-12 | 2025
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: 2025-12-13T13:26:53 | 2025-12-13T13:26 | 2025-12-13T13 | 2025-12-13 | 2025-12 | 2025
published_on false Find all articles published on the specified date. Supported formats include: Y-m-d.
Examples: 2025-12-13
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": 1499173,
        "returned": 10,
        "limit": 10,
        "page": 1
    },
    "data": [
        {
            "uuid": "d4a9345a-9dc8-47a2-87f2-9659b9fbeb97",
            "title": "He made his brothers get their arteries checked. Each had advanced heart disease.",
            "description": "Kevin Murray was his family's health watchdog. His vigilance helped his brothers",
            "keywords": "Health, Florida, Heart Disease",
            "snippet": "Kevin Murray knows the importance of cardiac health firsthand. The Tampa dad nearly died from an undiagnosed heart condition and needed to undergo emergency byp...",
            "url": "https://www.cbsnews.com/news/heart-disease-cardiac-ct-scan-health/",
            "image_url": "https://assets2.cbsnewsstatic.com/hub/i/r/2025/12/12/8e5e62a2-0e94-4cab-a8db-c48fd8ed543a/thumbnail/1200x630g2/ea0ac8e446eb9c83158e9c02345bb182/brothers-and-linda.jpg",
            "language": "en",
            "published_at": "2025-12-13T13:09:44.000000Z",
            "source": "cbsnews.com",
            "categories": [
                "general",
                "politics"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "45116575-d55d-4477-a601-eb0fb4096b9d",
            "title": "U.S. says it will lift some trade sanctions against Russian ally Belarus",
            "description": "John Coale, the U.S. special envoy for Belarus, said that normalizing relations between Washington and Minsk was",
            "keywords": "Belarus, Alexander Lukashenko",
            "snippet": "The United States says it is lifting sanctions on Belarusian potash in the latest sign of a thaw between Washington and the isolated autocracy.\n\nJohn Coale, the...",
            "url": "https://www.cbsnews.com/news/us-trade-sanctions-russian-ally-belarus/",
            "image_url": "https://assets1.cbsnewsstatic.com/hub/i/r/2025/12/13/6a3b9474-56a9-420a-af92-0a30f48d5831/thumbnail/1200x630/2ab873c860de5a9adf01ce349bf57ac2/ap25346468080859.jpg",
            "language": "en",
            "published_at": "2025-12-13T13:07:06.000000Z",
            "source": "cbsnews.com",
            "categories": [
                "general",
                "politics"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "1eb184f0-865c-4829-94c0-185515ec5625",
            "title": "Sheryl Crow Wrote a Breakup Song for Owen Wilson After Split",
            "description": "Sheryl Crow once dated Owen Wilson for two years and later wrote the haunting breakup track 'Safe and Sound' reflecting their split Sheryl Crow Owen Wilson brea...",
            "keywords": "",
            "snippet": "When it comes to Sheryl Crow’s relationships, she may be best-known for her long-term love and subsequent broken engagement from cyclist Lance Armstrong, but ...",
            "url": "https://www.usmagazine.com/entertainment/news/sheryl-crow-wrote-a-breakup-song-for-owen-wilson-after-split/",
            "image_url": "https://www.usmagazine.com/wp-content/uploads/2025/11/GettyImages-3202000.jpg?crop=0px%2C34px%2C804px%2C423px&resize=1200%2C630&quality=86&strip=all",
            "language": "en",
            "published_at": "2025-12-13T13:00:52.000000Z",
            "source": "usmagazine.com",
            "categories": [
                "entertainment",
                "general"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "68880c42-42e1-48aa-b6ab-fc647944b2a9",
            "title": "BROADCAST BIAS: Networks would rather slam Trump than report on massive Somali fraud",
            "description": "Investigation reveals broadcast networks devoted only 21% to 31% of Somali coverage to Minnesota billion-dollar fraud, focusing instead on Trump's critical comm...",
            "keywords": "",
            "snippet": "NEW You can now listen to Fox News articles!\n\nThe massive billion-dollar fraud allegedly committed by Somalis in Minnesota is still being submerged by the broad...",
            "url": "https://www.foxnews.com/opinion/broadcast-bias-networks-would-rather-slam-trump-than-report-massive-somali-fraud",
            "image_url": "https://static.foxnews.com/foxnews.com/content/uploads/2025/03/broadcast-bias-image.jpg",
            "language": "en",
            "published_at": "2025-12-13T13:00:37.000000Z",
            "source": "foxnews.com",
            "categories": [
                "general",
                "politics"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "8a914b41-6957-41db-95f2-d09b33f5c98c",
            "title": "Erika Kirk talks faith and grief, fields question from last person to speak to Charlie: How to watch the CBS News town hall",
            "description": "The last person to ask Charlie Kirk a question attended the town hall, airing at 8 p.m. ET/PT on CBS.",
            "keywords": "Erika Kirk, Charlie Kirk",
            "snippet": "Hunter Kozak was the last person to ask Charlie Kirk a question before the conservative commentator was assassinated in September. This week, the Utah Valley Un...",
            "url": "https://www.cbsnews.com/news/cbs-news-town-hall-erika-kirk-how-to-watch/",
            "image_url": "https://assets2.cbsnewsstatic.com/hub/i/r/2025/12/12/b9fccf16-c09e-4ddb-9b57-339686322470/thumbnail/1200x630/cd5c315546fe55dd318d931d1d61fb9c/town-hall.jpg",
            "language": "en",
            "published_at": "2025-12-13T13:00:21.000000Z",
            "source": "cbsnews.com",
            "categories": [
                "general",
                "politics"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "8f2475c4-c041-4823-a0dd-220f7da6cd6d",
            "title": "Broadcom, Oracle, Netflix, And More: 5 Stocks Investors Couldn't Stop Buzzing About This Week - Broadcom (NASDAQ:AVGO), Carvana (NYSE:CVNA)",
            "description": "Retail investors talked up five hot stocks this week (Dec. 8 to Dec. 12) on X and Reddit's r/WallStreetBets: AVGO, ORCL, NFLX, MSFT, CVNA.",
            "keywords": "",
            "snippet": "Retail investors talked up five hot stocks this week (Dec. 8 to Dec. 12) on X and Reddit's r/WallStreetBets, driven by earnings, retail hype, AI buzz, and corpo...",
            "url": "https://www.benzinga.com/markets/market-summary/25/12/49380465/broadcom-oracle-netflix-and-more-5-stocks-investors-couldnt-stop-buzzing-about-this-week",
            "image_url": "https://cdn.benzinga.com/files/images/story/2025/12/13/Deerfield---Circa-June-2019-Oracle-Corpo.jpeg?width=1200&height=800&fit=crop",
            "language": "en",
            "published_at": "2025-12-13T13:00:13.000000Z",
            "source": "benzinga.com",
            "categories": [
                "business"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "524ab373-c443-43f4-aa59-e35e8e9ee41a",
            "title": "Want to avoid getting sick on a plane this holiday season? Medical expert reveals best seat",
            "description": "A medical expert warns that holiday air travelers face greater risk from airborne respiratory viruses than surface contamination, recommending window seats and ...",
            "keywords": "",
            "snippet": "NEW You can now listen to Fox News articles!\n\nAmericans nationwide are getting ready to travel for the Christmas and holiday season, with many flying to see fri...",
            "url": "https://www.foxnews.com/travel/want-avoid-getting-sick-plane-holiday-season-medical-expert-reveals-best-seat",
            "image_url": "https://static.foxnews.com/foxnews.com/content/uploads/2025/06/interior-airplane-seats.jpg",
            "language": "en",
            "published_at": "2025-12-13T13:00:08.000000Z",
            "source": "foxnews.com",
            "categories": [
                "general",
                "politics"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "c724cfa8-4057-4f78-9ca1-ec1aa0393ab6",
            "title": "‘Vibe dating’ explodes as young singles ditch rules and chase instant chemistry",
            "description": "Gen Z embraces \"vibe dating\" trend, ditching traditional checklists for instant chemistry and connection over compatibility lists in relationships.",
            "keywords": "",
            "snippet": "NEW You can now listen to Fox News articles!\n\nYoung people are growing tired of dating checklists and are returning to \"good old-fashioned chemistry\" when looki...",
            "url": "https://www.foxnews.com/media/vibe-dating-explodes-young-singles-ditch-rules-chase-instant-chemistry",
            "image_url": "https://static.foxnews.com/foxnews.com/content/uploads/2025/12/gen-z-dating-vibes1.png",
            "language": "en",
            "published_at": "2025-12-13T13:00:03.000000Z",
            "source": "foxnews.com",
            "categories": [
                "general",
                "politics"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "7d7f115c-3a2b-460d-a642-8a70ab339d71",
            "title": "Help! I Was Forced to Break My Engagement for a Terrible Reason. I’d Rather Die Than Explain It to My Family.",
            "description": "Christmas is going to be a nightmare.",
            "keywords": "dear-prudence, advice, featured-rubric, slate-plus",
            "snippet": "Dear Prudence is Slate’s advice column. Submit questions here.\n\nDear Prudence,\n\nI broke off my engagement to my beloved fiancé, “Tristan,” in November. E...",
            "url": "https://slate.com/advice/2025/12/dear-prudence-broken-engagement-terrible-reason.html?via=rss",
            "image_url": "https://compote.slate.com/images/46d5e369-ba43-4818-aeef-978ab375ee4b.jpeg?crop=1560%2C1040%2Cx0%2Cy0&width=1560",
            "language": "en",
            "published_at": "2025-12-13T13:00:00.000000Z",
            "source": "slate.com",
            "categories": [
                "general"
            ],
            "relevance_score": null,
            "locale": "us"
        },
        {
            "uuid": "39579431-cee0-4e0d-8a98-70fdddb9de13",
            "title": "Public urination, boozing, other NYC quality-of-life complaints are surging and will get worse under Mamdani: critics",
            "description": "The NYPD has trumpeted an historic drop in major crimes this year, but its stats on quality-of-life complaints expose a city in decline that will likely get wor...",
            "keywords": "Metro, US News, eric adams, graffiti, jessica tisch, noise, nypd, public nuisance, quality of life, Zohran Mamdani",
            "snippet": "The Big Apple is getting pretty sour, soaring quality-of-life complaints show — and it will likely rot further under cop-hating, laissez-faire NYC Mayor-elect...",
            "url": "https://nypost.com/2025/12/13/us-news/public-urination-boozing-other-nyc-quality-of-life-complaints-are-surging-and-will-get-worse-under-mamdani-critics/",
            "image_url": "https://nypost.com/wp-content/uploads/sites/2/2025/12/117165189.jpg?quality=75&strip=all&w=1200",
            "language": "en",
            "published_at": "2025-12-13T12:55:06.000000Z",
            "source": "nypost.com",
            "categories": [
                "general"
            ],
            "relevance_score": null,
            "locale": "us"
        }
    ]
}
            
        

All News Available on: All plans

Endpoint

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

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

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

All text data returned is UTF-8.

All dates are in UTC (GMT).

HTTP GET Parameters

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

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

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

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

When using special characters (+, -, |, ", *, ()) you MUST URL-encode this parameter.
search_fields false Comma separated list of fields to apply the search parameter to.
Supported fields: title | description | keywords | main_text
Example: title,description,keywords
Default: title,main_text
categories false Comma separated list of categories to include.
Supported categories: general | science | sports | business | health | entertainment | tech | politics | food | travel
Example: business,tech
exclude_categories false Comma separated list of categories to exclude.
domains false Comma separated list of domains to include. List of domains can be obtained through our Sources endpoint, found further down this page.
exclude_domains false Comma separated list of domains to exclude
source_ids false Comma separated list of source_ids to include. List of source_ids can be obtained through our Sources endpoint, found further down this page.
exclude_source_ids false Comma separated list of source_ids to exclude.
language false Comma separated list of languages to include. Default is all.
Click here for a list of supported languages.
Examples: en,es (English + Spanish)
published_before false Find all articles published before the specified date. Supported formats include: Y-m-d\TH:i:s | Y-m-d\TH:i | Y-m-d\TH | Y-m-d | Y-m | Y.
Examples: 2025-12-13T13:26:53 | 2025-12-13T13:26 | 2025-12-13T13 | 2025-12-13 | 2025-12 | 2025
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: 2025-12-13T13:26:53 | 2025-12-13T13:26 | 2025-12-13T13 | 2025-12-13 | 2025-12 | 2025
published_on false Find all articles published on the specified date. Supported formats include: Y-m-d.
Examples: 2025-12-13
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": 54612194,
        "returned": 10,
        "limit": 10,
        "page": 1
    },
    "data": [
        {
            "uuid": "b645c217-1002-44af-b0e4-19ee8cc1666c",
            "title": "Умер актер Питер Грин",
            "description": "Он получил известность благодаря работам в картинах «Чистый, бритый», «Маска» и «Крими?...",
            "keywords": "",
            "snippet": "Американский актер Питер Грин скончался на 61-м году жизни. О его смерти сообщила газета ...",
            "url": "https://www.sobaka.ru/entertainment/cinema/208643",
            "image_url": "https://static.sobaka.ru/images/post/00/20/86/43/_rotator.png?v=1765622261",
            "language": "ru",
            "published_at": "2025-12-13T13:26:06.000000Z",
            "source": "sobaka.ru",
            "categories": [
                "entertainment"
            ],
            "relevance_score": null
        },
        {
            "uuid": "2c6f11ff-6674-44a2-be47-b3472039e29f",
            "title": "부산 노후계획도시 정비 선도지구 7318가구 선정…지방권 첫 사례",
            "description": "[뉴스데일리]국토교통부와 부산광역시는 12일 부산 화명·금곡지구와 해운대지구의 노후계획도시 정비를 위한 선도지구 ...",
            "keywords": "",
            "snippet": "해운대지구.(이미지=국토교통부 제공)\n\n[뉴스데일리]국토교통부와 부산광역시는 12일 부산 화명·금곡지구와 해운대지구?...",
            "url": "http://www.newsdaily.kr/news/articleView.html?idxno=252933",
            "image_url": "https://cdn.newsdaily.kr/news/thumbnail/202512/252933_166248_2422_v150.jpg",
            "language": "ko",
            "published_at": "2025-12-13T13:25:37.000000Z",
            "source": "newsdaily.kr",
            "categories": [],
            "relevance_score": null
        },
        {
            "uuid": "a89b43f3-a077-48da-a262-588d01836399",
            "title": "Ator de 'O Máskara' é encontrado morto aos 60 anos nos EUA",
            "description": "Peter Greene foi encontrado morto em seu apartamento; causa da morte não foi divulgada.",
            "keywords": "",
            "snippet": "Peter Greene, 60, conhecido por interpretar Dorian Tyrell no filme \"O Máskara\", foi encontrado morto em seu apartamento em Manhattan, Nova York, nos Estados Un...",
            "url": "https://www.uol.com.br/splash/noticias/2025/12/13/ator-de-o-maskara-e-encontrado-morto-aos-60-anos-nos-eua.htm",
            "image_url": "https://conteudo.imguol.com.br/c/splash/6a/2025/12/13/peter-greene-interpretou-dorian-tyrell-no-filme-o-maskara-1765620334854_v2_615x300.png",
            "language": "pt",
            "published_at": "2025-12-13T13:25:36.000000Z",
            "source": "uol.com.br",
            "categories": [
                "tech",
                "science"
            ],
            "relevance_score": null
        },
        {
            "uuid": "b81ebe72-528b-4b60-8509-800270bc992b",
            "title": "我国科学家重磅发现:地球深处可能存在一个“超级海洋”!",
            "description": "我国科学家重磅发现:地球深处可能存在一个“超级海洋”!",
            "keywords": ", 我国科学家重磅发现:地球深处可能存在一个“超级海洋”!, 快科技",
            "snippet": "我国科学家重磅发现:地球深处可能存在一个“超级海洋”!\n\n快科技12月13日消息,中国科学院广州地球化学研究所杜治?...",
            "url": "https://news.mydrivers.com/1/1092/1092353.htm",
            "image_url": "https://img1.mydrivers.com/img/20251213/cb82d70b19664f31a1ef9fc4f160b135.png",
            "language": "zh",
            "published_at": "2025-12-13T13:24:55.000000Z",
            "source": "news.mydrivers.com",
            "categories": [
                "tech",
                "general"
            ],
            "relevance_score": null
        },
        {
            "uuid": "2a51a871-4241-4c08-b1b5-2f5e4756a82d",
            "title": "[코툰] \"비트코인, 투기적 디지털 장난감\"",
            "description": "[코툰]비트코인,투기적디지털장난감 글로벌자산운용사뱅가드글로벌퀀트에쿼티(QuantitativeEquity)헤드존아메릭스(JohnAmeriks...",
            "keywords": "",
            "snippet": "",
            "url": "https://www.coinreaders.com/204046",
            "image_url": "https://www.coinreaders.com/imgdata/coinreaders_com/202512/800_436_2025121324401014.png",
            "language": "ko",
            "published_at": "2025-12-13T13:24:00.000000Z",
            "source": "coinreaders.com",
            "categories": [],
            "relevance_score": null
        },
        {
            "uuid": "ba343f77-3b49-4938-bb30-b1fdc8c21814",
            "title": "Comicomment: Unsealing the coffin and reviving militarism",
            "description": "",
            "keywords": "",
            "snippet": "Japanese Prime Minister Sanae Takaichi’s brazen remarks on Taiwan sound a stark warning that Japan’s militarist demons are being summoned anew.\n\nTakaichi Sa...",
            "url": "http://www.ecns.cn/cns-wire/2025-12-13/detail-ihexvcks1703121.shtml",
            "image_url": "http://image.cns.com.cn/ecns_editor/transform/20251213/C1cc-hexvcks1703115.jpg",
            "language": "en",
            "published_at": "2025-12-13T13:21:58.000000Z",
            "source": "ecns.cn",
            "categories": [
                "general"
            ],
            "relevance_score": null
        },
        {
            "uuid": "89b77214-cefe-44de-8c67-92c713eeb8f7",
            "title": "우주개발이 미래 국익에 얼마나 중요한지 이해하고 있는 대통령 : 클리앙",
            "description": "요즘 대통령 행보를 유투브를 통해서 시청하고 있다보면, 정말 고맙고 감사하고 감동적입니다. 이렇게 하고 싶어서 그동...",
            "keywords": "",
            "snippet": "요즘 대통령 행보를 유투브를 통해서 시청하고 있다보면,정말 고맙고 감사하고 감동적입니다.\n\n\n\n이렇게 하고 싶어서 그?...",
            "url": "https://www.clien.net/service/board/park/19109464",
            "image_url": "https://www.clien.net/service/image/favicon.ico",
            "language": "ko",
            "published_at": "2025-12-13T13:21:51.000000Z",
            "source": "clien.net",
            "categories": [
                "tech"
            ],
            "relevance_score": null
        },
        {
            "uuid": "06b58983-7bcc-45b7-864b-0e9c65ea0223",
            "title": "Back to the Oldschool Days...",
            "description": "",
            "keywords": "",
            "snippet": "",
            "url": "http://oldschoolerscrew.blogspot.com/feeds/5379657752601040543/comments/default",
            "image_url": "",
            "language": "pl",
            "published_at": "2025-12-13T13:21:46.000000Z",
            "source": "oldschoolerscrew.blogspot.com",
            "categories": [],
            "relevance_score": null
        },
        {
            "uuid": "9b5e7bdc-26d5-4e32-9bbf-a2075307a65f",
            "title": "Fußball Bundesliga Frauen: Freiburg gegen SGS Essen - Liveticker - 13. Spieltag - 2025/2026",
            "description": "Liveticker vom Spiel SC Freiburg gegen SGS Essen vom 13.12.2025: heute live.",
            "keywords": "",
            "snippet": "90. +5 Fazit:\n\nSchlusspfiff im Dreisamstadion! Freiburg und Essen trennen sich nach 90 intensiven Minuten torlos 0:0. Der SC Freiburg klettert damit vorerst auf...",
            "url": "https://www.sportschau.de/live-und-ergebnisse/fussball/deutschland-bundesliga-frauen/ma11376572/sc-freiburg_sgs-essen/liveticker",
            "image_url": "https://images.sportschau.de/image/d2504cb5-de3a-4636-800d-630678c10080/AAABlpWrDNo/AAABmt42H9g/16x9-big/fussball-frauen-bundesliga-leverkusen-leipzig-100.jpg?width=1280",
            "language": "de",
            "published_at": "2025-12-13T13:21:10.000000Z",
            "source": "www1.wdr.de",
            "categories": [
                "general"
            ],
            "relevance_score": null
        },
        {
            "uuid": "63a76c65-79c8-4238-b78c-3a8e3e99cf1e",
            "title": "Fußball 2. Bundesliga: Live-Konferenz - 16. Spieltag - 2025/2026",
            "description": "Die Live-Konferenz des aktuellen Spieltags in der 2. Bundesliga im Fußball: heute live.",
            "keywords": "",
            "snippet": "Magdeburg Kiel 61. Marcel Rapp schickt mit Skrzybski, der die Kapitänsbinde übernimmt, und Schwab die ersten Einwechselspieler auf das Feld. Kaprálik und Wag...",
            "url": "https://www.sportschau.de/live-und-ergebnisse/konferenz/ac2455/",
            "image_url": "https://images.sportschau.de/image/58a70577-d431-4115-9fea-2533e15aff67/AAABlcRbC90/AAABmt42H9g/16x9-big/ball-sp-108.jpg?width=1280",
            "language": "de",
            "published_at": "2025-12-13T13:21:10.000000Z",
            "source": "www1.wdr.de",
            "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: 2025-12-13T13:26:53 | 2025-12-13T13:26 | 2025-12-13T13 | 2025-12-13 | 2025-12 | 2025
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: 2025-12-13T13:26:53 | 2025-12-13T13:26 | 2025-12-13T13 | 2025-12-13 | 2025-12 | 2025
published_on false Find all articles published on the specified date. Supported formats include: Y-m-d.
Examples: 2025-12-13
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=2025-12-06
    

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