Simple News Search

A Specrom News API endpoint for fetching latest news within past 24h with full_text content.

We reccomend that all the new users try out this API endpoint before using the other more advanced keyword search endpoints only when they either need more results (using similar keyword search), or need results with very low latency (instead of 24h in this case) or historical search.

This endpoint will fetch news articles with full-text using variety of inputs.


import requests

url = "https://specrom-news-api.p.rapidapi.com/"

payload = {
  "api_type": "exhaustive_news_search_24h",
  "q": "bitcoin",
  "author_only": "",
  "content": "",
  "domains": "",
  "page": "1",
  "qInTitle": "",
  "topic": ""
}
headers = {
  "content-type": "application/json",
  "X-RapidAPI-Key": "API_Key",
  "X-RapidAPI-Host": "specrom-news-api.p.rapidapi.com"
}

response = requests.request("POST", url, json=payload, headers=headers)

print(response.text)
	
	POST / HTTP/1.1
Content-Type: application/json
X-Rapidapi-Key: API_Key
X-Rapidapi-Host: specrom-news-api.p.rapidapi.com
Host: specrom-news-api.p.rapidapi.com
Content-Length: 192

{
    "api_type": "exhaustive_news_search_24h",
    "q": "bitcoin",
    "author_only": "",
    "content": "",
    "domains": "",
    "page": "1",
    "qInTitle": "",
    "topic": ""
}
	
	
Parameter Description
api_type exhaustive_news_search_24h
domains The domain url for filtering by news source. In this version, you can only specify one domain address. In case you do not want to filter by domain address, than simply leave the field empty ("")
topic: Filter the news articles by their topic. Options include: “politics”, “tech”, “entertainment”, “business”, “sport”. If you want to fetch all articles without topic filtering, than simply specify “”.
q filter the news articles by a keyword; optionally you can simply leave it empty ("") if you do not wish to filter by keyword. Only one keyword is supported by this API; if you want to search by phrases, than we reccomend using our keyword news search endpoint
qInTitle filter the news articles by a keyword present in the title. Only one keyword is supported by this endpoint.
content If you want full text of the news articles in the content key of the response JSON then set this field to “true” otherwise set it to “false”.
author_only (optional) if “true” then it only returns results with author names.

Output


{
  "Article": [
    {
      "author": "[\"Lauren Fox and Ted Barrett, CNN\"]",
      "description": "Divisions within the Republican conference spilled out once again Tuesday as GOP senators dismissed key pieces of their own leadership's stimulus proposal not even a day after its release.",
      "publishedAt": "2020-07-28",
      "source_name": "CNN",
      "source_url": "cnn.com",
      "title": "Republicans revolt against GOP's initial stimulus plan  - CNNPolitics",
      "url": "https://www.cnn.com/2020/07/28/politics/republican-reaction-gop-stimulus-plan/index.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+rss%2Fcnn_allpolitics+%28RSS%3A+CNN+-+Politics%29",
      "urlToImage": "https://cdn.cnn.com/cnnnext/dam/assets/200518181852-senator-ben-sasse-1-super-tease.jpg"
    },
    .
    .
    (output truncated)
    ],
  "status": "ok",
  "totalResults": 113
}

This endpoint returns a JSON object containing the following elements:

Parameter Description
status This key will return “ok” if results from all the shards are being fetched correctly. Please raise a support ticket with us by email to info@specrom.com if is reporting a “fail”.
totalResults this mentions the total number of articles found by our endpoint. Note: this is not exhaustive results for You can use our other keyword search endpoint
Article This key contains a list of dictionaries representing individual news articles.
Author A list of author names for the news articles.
content: Full text of the news articles (upto 30% text); we trncate the full_text at 30% to respect the rights of the original copyright holder. If your use-case does’nt involve making the full_text public (such as using it for internal data analytics, training an AI model etc) , then you can get the entire full_text of each news article using fetch complete news article by URL endpoint.
title: title of the news article
description description of the news article extracted and parsed from meta tags of the HTML page.
publishedAt publication date of the news article (based on on UTC timezone).
source_name Name of the news source.
source_url domain address of the news source.
url url of the news article
urlToImage url of the most relevant image from the news article.