OKSURF Google News API

Always available and always free for programmatic consumption

Get Started

News is available for each major Google News section

The OKSURF News API provides a simple, free REST API for developers to retrieve the latest Google news in a familiar JSON format

  • This news service is absolutely free
  • No account or signup is required
  • Retrieve all Google News headlines
  • No request limiting forced on developers
Swagger
Each article in a response will contain the following:
title: article title
link: article URL
og: og:image URL
source: name of news source
source_icon: source logo/icon URL

years operating

daily users

available endpoints

daily requests

Features

News is available for each major Google News section: US, World, Business, Technology, Entertainment, Sports, Science, & Health

Endpoints are available with and without CORS headers

Developer friendly endpoints for backends and frontends

Access the API with your favorite programming language

Use your preferred language's HTTP client to make requests

Swagger documentation is available

Test the API in your browser and view example CURL commands

Works well with coffee

Hot or iced, coffee can improve the overall API experience

Endpoints

Retrieve the latest Google news as valid JSON.

  • /news-section-names
    GET

    Fetch available Google News section names, such as World, Sports, and Science

  • /news-feed
    GET

    Retrieve all available Google News articles, for all available section names

  • /news-section
    POST

    Get all available news articles for the specified Google News section name(s)

  • Response

    • The /news-feed and /news-feed-section endpoints both return a serialized JSON array of objects; each object is an article
    • Each article/object in the response array will contain the following key/value pairs:
      title: article title
      link: article URL
      og: og:image URL
      source: source name
      source_icon: source logo URL

    Try It

    Use the below Swagger documentation to try the API. Select an endpoint and and press Try it out. An API response and CURL command will be visible after pressing the Execute button.

    Use the OkSurf API with your favorite programming language. Here are some simple examples:

    curl -X 'GET' \
      'https://ok.surf/api/v1/news-feed' \
      -H 'accept: application/json'
    
    
    curl -X 'POST' \
      'https://ok.surf/api/v1/news-section' \
      -H 'accept: application/json' \
      -H 'Content-Type: application/json' \
      -d '{"sections": ["Business"]}'
    from json import load
    from pprint import pprint
    from urllib.request import Request, urlopen
    
    
    req = Request('https://ok.surf/api/v1/news-feed')
    req.add_header('accept', 'application/json')
    req.add_header('Content-Type', 'application/json')
    response = load(urlopen(req))
    pprint(response)
    fetch('https://ok.surf/api/v1/cors/news-feed').then((res) => {
      if (!res.ok) {
        throw Error('could not fetch data for that resource');
      }
      return res.json();
    }).then((data) => {
      console.log(data);
    }).catch((err) => {
      console.log(err);
    });
    
    
    fetch('https://ok.surf/api/v1/cors/news-section', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        sections: ['Business'],
      })
    })
    .then(response => {
      if (!response.ok) {
        throw new Error(`Error: ${response.statusText}`);
      }
      return response.json();
    })
    .then(data => {
      console.log('Success:', data);
    })
    .catch(error => {
      console.error('Error:', error);
    });

    Example News Feed

    Use our API to power news-feeds in your applications. The most recent Google news update is only an API request away. While there are many different use-cases for retrieving the news in your own software, here is an example front-end news feed driven by the oksurf REST API: