OkSurf News API

Free for programmatic consumption

Swagger


 Services

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

Other Features

News is available for each major Google News section

US, World, Business, Technology, Entertainment, Sports, Science, & Health

Endpoints are available with or 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 right 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 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)

  •   Each article in the response will contain the following keys:
    titlearticle title
    linkarticle URL
    ogog:image URL
    sourcename of news source
    source_iconsource logo/icon 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"]}'
  

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

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)
  


 Feed

Use our API to power news-feeds in your applications.

  Example news feed driven by the OkSurf API:
Loading...