Developer API v1 Updated every 3 hours
Developer API

Forex Sentiment API

The same news sentiment scores that power the FXNewsBias dashboard, served straight to your code as clean JSON. Eight major currencies, refreshed every three hours, around the clock, plus gold (XAU/USD) on Pro. Free key for every account; real-time data on Pro.

Listed on public-apis and awesome-quant. Official client on PyPI.

Key active
Your access

Checking your account...

Endpoints

Five GET endpoints, plus four Markets (Pro) endpoints for gold further down, all authenticated with the same key. Base URL https://fxnewsbias.com. Machine-readable spec: openapi.json, OpenAPI 3.1, import it straight into Postman, Insomnia or a client generator.

GET
/api/v1/sentiment
News sentiment score for the 8 major currencies. Real-time on Pro; free keys get the previous 3-hour cycle
Free + Pro
GET
/api/v1/session-bias
Pair scorecard for the newest settled session, tone and conviction
Pro
GET
/api/v1/sentiment/history
Every 3-hour sentiment read since 19 May 2026. Filter by currency, from, to, page with limit and offset
Pro
GET
/api/v1/session-bias/history
The settled ledger since 6 Aug 2026: entry price, result price, move and whether the call aligned. Misses included
Pro
GET
/api/v1/usage
Your tier, daily allowance, calls spent today and when it resets. Does not count against the allowance, so poll it freely
Free + Pro

Free keys serve forward data: the current read, one 3-hour cycle behind. Everything else is on Pro, which removes the delay, raises the allowance to 1,000 a day and opens both history endpoints, the live session bias and the gold markets endpoints. The scorecard history returns settled reads only, so every row has a real outcome attached. Pro starts with a 7-day free trial, see the plans.See the plans.

Quickstart

Bearer header only. Keys are never accepted in the URL or query string.

curl -H "Authorization: Bearer $FXNB_KEY" \
  https://fxnewsbias.com/api/v1/sentiment

Python

Official client, MIT licensed, no required dependencies.

pip install fxnewsbias
from fxnewsbias import Client

fx = Client("fxnb_live_...")

# the whole point: a yes or no on the pair you are about to trade
fx.sentiment().favours("AUD/USD")   # 'long', 'short', or None
fx.sentiment().spread("AUD/USD")    # 13  (AUD 68 - USD 55)

The scores move every few hours, so follow() waits for the next one instead of polling on a timer. A 15-minute loop spends 96 calls a day; this spends about 8.

for s in fx.follow():
    print(s["AUD"].score)   # blocks until the data actually changes

Gold, on Pro keys, from fxnewsbias 1.2.0 (pip install -U fxnewsbias). Details under Markets (Pro).

m = fx.markets()
gold = m.get("XAU")                # None until the first gold read
if gold:
    print(gold.score, gold.pair.bias)   # e.g. 64 Bullish

Source on GitHub · PyPI

Response shape

{
  "schema": "fxnb.sentiment.v1",
  "generated_at": "2026-08-21T09:00:12Z",
  "next_update_expected": "2026-08-21T12:00:00Z",
  "attribution": {
    "required": true,
    "text": "Data by FXNewsBias",
    "url": "https://fxnewsbias.com"
  },
  "data": [
    { "currency": "USD", "score": 72, "bias": "Bullish",
      "updated_at": "2026-08-21T09:00:00Z" },
    ... 7 more
  ]
}
FieldContract, frozen. v1 never changes shape
dataAlways exactly 8 rows, ordered USD, EUR, GBP, JPY, AUD, CAD, CHF, NZD
scoreInteger 0 to 100. 50 is the neutral midpoint, higher is bullish news tone, lower is bearish
biasExactly one of Bullish, Bearish, Neutral
updated_atISO-8601 UTC. When the score was computed
next_update_expectedWhen the next refresh lands. Sleep until this, then poll once
delayedFree-tier responses only: true, alongside delay_hours: 3. The scores are from the previous cycle. Absent on Pro

Tiers and rate limits

FreePro
Price$0, no cardFrom $20/month, 7-day free trial
Requests per UTC day251,000
Data freshnessPrevious 3-hour cycle (3 to 6 hours old)Current cycle, real-time
/api/v1/sentimentYes, delayedYes, real-time
/api/v1/session-biasNoYes
/api/v1/sentiment/historyNoYes
/api/v1/session-bias/historyNoYes
/api/v1/markets and its 3 sub-paths (gold)NoYes, real-time
/api/v1/usageYes, free of allowanceYes, free of allowance
UseNon-commercial, with attributionCommercial use in your own product
  • Both tiers reset at 00:00 UTC. Every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset
  • One over the limit returns 429 with a Retry-After header
  • The allowance follows the account, not the key, so regenerating a key does not reset it
  • Free responses include "delayed": true, "delay_hours": 3 so the freshness is never ambiguous

Errors

StatusBodyWhen
400{"error":"bad-from", "message":"..."}A parameter was rejected. Validated before the allowance is claimed, so a bad request costs you nothing
401{"error":"unauthorized", "message":"..."}Missing header, malformed header, or a key that is not active. The message says which of the three
403{"error":"pro-only", "message":"..."}The key is valid but on the free tier, and the endpoint is Pro only: the live session bias or any Markets path. Markets responses also carry an upgrade link. Returned before the allowance is claimed
404{"error":"not-found", "endpoints":[...]}No endpoint at that path. Paths are exact and take no trailing slash. The body lists the real ones
405{"error":"method-not-allowed"}Anything but GET
429{"error":"rate-limited","retry_after_seconds":n}Past your daily limit
  • Branch on error, never on message. The code is part of the frozen contract, the wording is not
  • Working integration suddenly returning 401? Regenerating a key replaces the previous one. If someone clicked regenerate in the panel, anything still sending the old key stops there. Create a new key and update your integration
  • 502 and 500 are ours and safe to retry. 400, 401 and 404 will not change on a retry, so fix the request instead

Attribution and terms

  • Wherever the data is displayed or republished, keep the attribution "Data by FXNewsBias" linking to https://fxnewsbias.com. It ships in every response
  • Free tier is for personal and non-commercial projects. A Pro subscription covers commercial use inside your own product
  • No redistribution, resale, or using the data to build a competing sentiment service, on either tier
  • One key per account. Sharing a key across separate users or products is not permitted and is detectable
  • One key for the life of the account. It upgrades to Pro automatically when your subscription or trial starts, and returns to the free tier when Pro ends. The key string never changes, so your integration keeps working either way, on free limits afterwards
  • Questions, higher volume, or a data licence: contact@fxnewsbias.com

Staying current without wasting quota

Scores publish on a fixed 3-hour cycle. Rather than polling blindly, read next_update_expected and come back then. You get the new data within seconds of publication and spend about 8 requests a day. Gold on the Markets endpoints is scored right after the currency cycle, usually one to three minutes after next_update_expected, so poll those about 3 minutes later and retry a minute after that if updated_at has not changed.

import requests, time
from datetime import datetime, timezone

H = {"Authorization": "Bearer " + FXNB_KEY}

while True:
    r = requests.get("https://fxnewsbias.com/api/v1/sentiment", headers=H).json()
    handle(r["data"])
    nxt = datetime.fromisoformat(r["next_update_expected"].replace("Z", "+00:00"))
    time.sleep(max(30, (nxt - datetime.now(timezone.utc)).total_seconds() + 20))

Markets (Pro)

Gold (XAU/USD) is served on its own endpoints, so the sentiment endpoint above keeps exactly 8 currency rows. Same key, same Bearer header, same 1,000-a-day allowance and rate headers as every other call. These paths are Pro only: a free key gets 403 with "error": "pro-only". More instruments will join the same endpoints later, so treat data as a list and never assume its length. The markets covered today are listed on the Markets page; the free XAU/USD label, one cycle delayed, is on the XAU/USD page.

GET
/api/v1/markets
Latest read for every market. Today that is gold: score, bias, up to 3 drivers and the XAU/USD pair read against the US dollar
Pro
GET
/api/v1/markets/history
Every 3-hour gold read. symbol=XAU is required; from, to, limit and offset work as on the sentiment history
Pro
GET
/api/v1/markets/session-bias
The newest XAU/USD session call: tone, strength, session and entry time. symbol=XAU is required
Pro
GET
/api/v1/markets/session-bias/history
Settled XAU/USD calls with entry and result price, the move in percent, dollars and pips, alignment and a gold-only summary. Misses included. symbol=XAU is required
Pro

curl

curl -H "Authorization: Bearer $FXNB_KEY" \
  https://fxnewsbias.com/api/v1/markets

curl -H "Authorization: Bearer $FXNB_KEY" \
  "https://fxnewsbias.com/api/v1/markets/history?symbol=XAU&from=2026-10-01&limit=100"

Python, with requests

import requests

H = {"Authorization": "Bearer " + FXNB_KEY}
BASE = "https://fxnewsbias.com/api/v1/markets"

r = requests.get(BASE, headers=H)
if r.status_code == 403:   # free key: gold is a Pro feature
    raise SystemExit(r.json()["message"])

# data is a list that grows, so look gold up by symbol
gold = next((m for m in r.json()["data"]
             if m["symbol"] == "XAU"), None)
if gold:
    # e.g. 64 Bullish Bullish
    print(gold["score"], gold["bias"], gold["pair"]["bias"])

# settled, aligned, contra, aligned_pct, gold only
calls = requests.get(BASE + "/session-bias/history",
                     headers=H, params={"symbol": "XAU"}).json()
print(calls["summary"])

The official Python client covers the same four endpoints from fxnewsbias 1.2.0: fx.markets(), fx.markets_history("XAU"), fx.market_session_bias("XAU") and fx.market_session_bias_history("XAU"). A free key raises PlanError with the server's message.

Response shape

{
  "schema": "fxnb.markets.v1",
  "generated_at": "2026-10-05T09:00:14Z",
  "next_update_expected": "2026-10-05T12:00:00Z",
  "attribution": { ... same object as every response ... },
  "data": [
    {
      "symbol": "XAU", "name": "Gold",
      "score": 64, "bias": "Bullish",
      "drivers": ["Softer US inflation data lifts rate cut expectations",
                  "Central bank gold buying continues"],
      "updated_at": "2026-10-05T09:00:09Z",
      "pair": { "name": "XAU/USD", "quote": "USD",
                "quote_score": 51, "gap": 13, "bias": "Bullish" }
    }
  ]
}

Fields

FieldMeaning
dataOne entry per market. Today it holds gold only. Instruments will be added, so find gold by symbol and never assume a fixed length or position
symbol, nameXAU and Gold
scoreInteger 0 to 100, gold's own sentiment on the same scale as the currencies. 50 is neutral
biasFrom the score: Bullish at 60 or higher, Bearish at 40 or lower, Neutral in between
driversUp to 3 short phrases naming the catalysts behind the score
pair.gapGold's score minus pair.quote_score, the latest US dollar score. null if no dollar score was available
pair.biasBullish above +10, Bearish below -10, Neutral in between, the same thresholds as every pair on the site. null when gap is
move_pipsOn the session history: 1 pip = $0.10 per ounce, so move_pips is move_usd times 10. Every response there repeats this in pip_convention

Behaviour

  • A free key gets 403 {"error":"pro-only","message":"Gold and other markets are a Pro feature.","upgrade":"https://fxnewsbias.com/pricing"}, before any allowance is claimed
  • A missing or unsupported symbol is a 400 {"error":"bad-symbol"}, and a bad date or page parameter gets the same codes as the sentiment history. Both are checked before the allowance is claimed
  • Each call that passes those checks counts once against the same 1,000-a-day Pro allowance. /api/v1/usage shows the combined total
  • Gold is scored every 3 hours, on the same cycle as the currencies. Session calls are published on weekdays for the Asia, London and New York sessions, like the forex scorecard, and are never mixed into the forex scorecard or its hit rate
  • /api/v1/markets lists only markets that already have a reading, so data can be an empty list before a market's first read. Find a market by symbol, never by position
  • /api/v1/markets/session-bias returns "data": null until a first call exists. The history endpoints give the start of each gold series in coverage_from
  • Gold prices used to settle session calls are an hourly reference, indicative and not an official benchmark

Frequently asked questions

What is a forex sentiment API?

A forex sentiment API returns a machine readable measure of how positive or negative published news is for each currency. The FXNewsBias API returns a 0 to 100 score for the 8 major currencies as JSON. Above 50 leans bullish, below 50 leans bearish, and 50 is neutral.

How often is the forex sentiment data updated?

Scores are recomputed every 3 hours on a fixed cycle, eight times a day from 00:00 UTC, seven days a week. Every response carries a next_update_expected timestamp so you can sleep until the next publication instead of polling blindly. See how the scoring works.

Which currencies does the API cover?

USD, EUR, GBP, JPY, AUD, CAD, CHF and NZD. The sentiment endpoint always returns exactly 8 rows in that order, so the shape never changes between calls. Gold (XAU/USD) is served on its own Pro endpoints under /api/v1/markets, so the sentiment endpoint keeps exactly 8 rows. Browse the live currency scores.

Does the API cover gold (XAU/USD)?

Yes, on Pro. /api/v1/markets returns the latest gold sentiment score, its bias, up to three drivers and the XAU/USD pair read against the US dollar. /api/v1/markets/history serves every 3-hour gold read, /api/v1/markets/session-bias the newest XAU/USD session call and /api/v1/markets/session-bias/history the settled XAU/USD calls with their results. They use the same key and the same 1,000-a-day allowance as every other call. Free keys get a 403 on these paths; the XAU/USD bias label is on the website, one cycle delayed. See the Markets (Pro) reference.

How much does the forex sentiment API cost?

The free tier costs nothing: 25 requests a day with data one cycle behind, no card required. Real-time access is included with FXNewsBias Pro, from $20 per month billed yearly ($25 on 3 months, $30 monthly), which starts with a 7 day free trial. There is no separate API fee. See what else Pro includes.

Is there a free tier?

Yes. Any signed-in account can create a free key from the panel at the top of this page, no card required. It allows 25 requests a day on the sentiment endpoint and serves the previous 3-hour cycle, so the data is between 3 and 6 hours old. Built for testing, learning and non-commercial projects, with attribution. When you need the current cycle, Pro is real-time.

What is the rate limit?

Free keys: 25 requests per UTC calendar day. Pro: 1,000 per day per account. Both reset at 00:00 UTC. Every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset headers, and going over returns HTTP 429 with a Retry-After header.

Does the API provide historical sentiment data?

Yes, on Pro. /api/v1/sentiment/history serves every 3-hour read since 19 May 2026, and /api/v1/session-bias/history serves the settled session ledger since 6 August 2026 with entry price, result price and whether the call aligned, misses included. Both page with limit and offset. Gold history is on /api/v1/markets/history and /api/v1/markets/session-bias/history from the first gold read; each response gives the exact start in coverage_from. Free keys serve the current read only, one cycle behind. Pro includes all of them, with a 7-day free trial, see the plans.

How do I get an API key?

Create a free account, sign in, and the key panel at the top of this page creates one instantly. There is no application form, no waiting list, no card, and no email delivery. The key is shown once at creation because only a fingerprint of it is stored. Subscribing upgrades that same key to Pro automatically, so there is no second key to fetch and nothing to reconfigure.

Where the data comes from