Documentation

Discover how to use our ✨Free✨ REST News API.

Note:This API is still in development. As a result, there may be occasional bugs, or the server might experience downtime. We follow a versioning system, ensuring that endpoints like news/v1 remain stable with no significant changes as possible.

Buy Me a Coffee

https://www.api.thefreenewsapi.com/api/news/v1

Parameters:

  • query: ?string — The search term to look for
  • max: ?integer — The max number of articles to returned
  • with a maximum of 150 and default of 20 articles
  • apiKey: string — Your API key
  • category: ?enum
  • [Available categories: "Business", "Entertainment", "Health", "Science", "Technology","Sports",
  • sort: ?enum
  • [Available sorting:"ASC", "DESC"]
  • language: ?string — The language of the news
  • sourceCountry: ?string — The country of the news
  • [Available countries: "UnitedStates", "UnitedKingdom", "Netherlands", "Germany", "France", "China", "Spain" (more coming soon ☺️)]

Return parameters:

  • title: string — The title of the news
  • description: ?string — The description of the news
  • category: string — The category of the article
  • sentiment: float — Sentiment analysis result
  • source: string — The source of the news
  • imageUrl: ?string — URL of the image associated with the news
  • date: string (ISO 8601 format) — The date of the article
  • websiteUrl: string — URL to the article
  • languages: string — The language of the news returned

Example URL:

https://www.api.thefreenewsapi.com/api/news/v1?apiKey=xxxxx-xxxxx-xxxxx-xxxxx-xxxxx&category=business&sort=DESC&language=English&sourceCountry=UnitedStates&max=3

Example Usage for React.js:


  const response = await axios.get(
  "https://www.api.thefreenewsapi.com/api/news/v1",
  {
    params: {
      apiKey: "xxxxx-xxxxx-xxxxx-xxxxx-xxxxx",
      category: 'business',
      sort: "desc",
      query: "bitcoin",
      language: "english",
      sourceCountry: "unitedStates",
      max: 3,
    }
  }
);