Skip to main content
GET
/
news
Get news articles
curl --request GET \
  --url https://api.financialdatasets.ai/news \
  --header 'X-API-KEY: <api-key>'
import requests

url = "https://api.financialdatasets.ai/news"

headers = {"X-API-KEY": "<api-key>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {'X-API-KEY': '<api-key>'}};

fetch('https://api.financialdatasets.ai/news', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.financialdatasets.ai/news",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "X-API-KEY: <api-key>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.financialdatasets.ai/news"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("X-API-KEY", "<api-key>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.financialdatasets.ai/news")
  .header("X-API-KEY", "<api-key>")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.financialdatasets.ai/news")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["X-API-KEY"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "news": [
    {
      "ticker": "<string>",
      "title": "<string>",
      "source": "<string>",
      "date": "2023-12-25",
      "url": "<string>"
    }
  ]
}
{
  "error": "Bad Request",
  "message": "Invalid request parameters"
}
{
  "error": "Unauthorized",
  "message": "Invalid API key provided"
}
{
  "error": "Payment Required",
  "message": "This endpoint requires a paid subscription. Please upgrade your plan."
}
{
  "error": "Not Found",
  "message": "Ticker XXXX not found"
}

Overview

The News API lets you pull recent news articles for a given ticker, or broad market news when no ticker is provided. Our news articles are sourced from public RSS feeds. Market news covers AI, macro, rates, earnings, geopolitics, energy, crypto, and other market-moving topics. To get started, please create an account and grab your API key at financialdatasets.ai. You will use the API key to authenticate your API requests.

Coverage

TickersYears of CoverageUpdated
10,000+2+ yearsWithin 10 minutes

Getting Started

There are only 3 steps for making a successful API call:
  1. Add your API key to the header of the request as X-API-KEY.
  2. Add the ticker query param to get company-specific news, or omit it for broad market news. Optionally add limit to control the number of results.
  3. Execute the API request.

Examples

import requests

# add your API key to the headers
headers = {
    "X-API-KEY": "your_api_key_here"
}

# set your query params
ticker = 'AAPL'
limit = 5  # optional, max is 10

# create the URL
url = (
    f'https://api.financialdatasets.ai/news'
    f'?ticker={ticker}'
    f'&limit={limit}'
)

# make API request
response = requests.get(url, headers=headers)

# parse news from the response
news = response.json().get('news')
import requests

# add your API key to the headers
headers = {
    "X-API-KEY": "your_api_key_here"
}

# omit ticker to get broad market news
limit = 10

# create the URL
url = (
    f'https://api.financialdatasets.ai/news'
    f'?limit={limit}'
)

# make API request
response = requests.get(url, headers=headers)

# parse market news from the response
news = response.json().get('news')

Authorizations

X-API-KEY
string
header
required

API key for authentication.

Query Parameters

ticker
string

The ticker symbol of the company. Omit for broad market news.

limit
integer
default:5

The maximum number of news articles to return (default: 5, max: 10).

Required range: x <= 10

Response

News articles response

news
object[]