EXAMPLES

Paste it. Run it. Change it.

Thirteen recipes against the live API, in curl, Python, JavaScript and TypeScript. Pick a language once and every recipe switches. Anything with a Free badge needs no key.

  1. Run a free one. Recipes 1, 7 and 12 return real data with no key.
  2. Read the price. Every paid pull has a free preview that shows the exact cost.
  3. Add your key. Paid examples read GETFIXN_KEY. Keep the key out of code you share.
  4. Building a bot? Prediction-market signals are recipe 12. Paying from a crypto wallet is recipe 13.

Setup: Python 3.9+ with pip install requests. Node 18+ for JavaScript. TypeScript runs on Node 22.6+ (node file.ts) or with tsx. Paid examples read GETFIXN_KEY from the environment: export GETFIXN_KEY=tfx_live_...

01 / RECIPE

Your first call

Free, no key

Ask the API what it can do, then ask for live weather at one spot. No key, no signup. If this prints a temperature, your setup works.

Calling with no parameters returns the free menu: every dataset, its example call and its price. Previews are free and limited to 60 requests per minute per IP.

curl -s https://data.truefixr.com/v1/data | head -c 400
curl -s "https://data.truefixr.com/v1/data?dataset=weather&lat=32.78&lon=-96.80"
response, trimmed
{
  "location": { "lat": 32.784859, "lon": -96.802979 },
  "alerts": [],
  "nowcast": { "raining_now": true },
  "temperature_f": 72.4259,
  "wind_gust_mph": 13.7615,
  "billed": false
}

02 / RECIPE

Past Storm Leads by Address for a county

Free preview, paid pull needs a key

Reported and radar-detected storms matched to street addresses. The free preview says how many addresses match and what the pull would cost. Look at that before you pay, and cap the spend with limit.

Price: $0.05 per address. A paid pull returns at most 2,000 addresses unless you raise limit (up to 5,000), so read estimated_cost_usd first. The preview is free and needs no key. The paid half only runs when GETFIXN_KEY is set.

# free preview: counts and the exact price
curl -s -G https://data.truefixr.com/v1/data \
  -d dataset=storms -d county=Loving -d state=TX -d peril=HAIL -d days=90

# paid pull (needs a key): 25 addresses at most = $1.25 at most
curl -s -G https://data.truefixr.com/v1/data \
  -d dataset=storms -d county=Dallas -d state=TX -d peril=HAIL -d days=90 \
  -d addresses=true -d limit=25 \
  -H "Authorization: Bearer $GETFIXN_KEY"
response, trimmed
{
  "dataset": "storms",
  "county": "dallas",
  "state": "TX",
  "total_leads": 1244040,
  "storm_types": { "HEAVY_RAIN": 1307242, "THUNDERSTORM_WIND": 88497 },
  "repeat_addresses": 117589,
  "estimated_cost_usd": 100.0
}   // free preview, trimmed. Dallas figures are from the API docs.

03 / RECIPE

Storm History by Address within 1 to 25 miles of a point

Free preview, paid pull needs a key

Send a latitude and longitude (or a street address) and a radius. The free preview counts the report lines inside the circle by kind of storm and gives the exact price.

radius_mi runs from 1 to 25 and defaults to 5. The preview is free. The full report is $0.05 per line with a $10 minimum, and it is one report with all 11 event categories. Add addresses=true and your key to buy it.

# free preview
curl -s -G https://data.truefixr.com/v1/data \
  -d dataset=history -d lat=33.9257 -d lon=-84.5781 -d radius_mi=10

# paid (needs a key): the full report
curl -s -G https://data.truefixr.com/v1/data \
  -d dataset=history -d lat=33.9257 -d lon=-84.5781 -d radius_mi=10 -d addresses=true \
  -H "Authorization: Bearer $GETFIXN_KEY"
response, trimmed
{
  "dataset": "history",
  "radius_mi": 10.0,
  "real_line_count": 994,
  "estimated_cost_usd": 49.7,
  "by_peril": { "hail": 223, "wind": 414, "flood": 71, "lightning": 23, "tornado": 24, "hurricane": 27, "winter": 139, "...": "..." }
}   // free preview, trimmed, real output for this point on 2026-10-03

04 / RECIPE

Storm History by Address by date of loss

Free preview, paid pull needs a key

Was there reported weather near an address on a given day? Add a date and the free preview answers yes or no. The paid report adds the events just before and after, with a reference ID you can cite.

The yes or no depends on the radius you set (default 5 miles). A storm record is reported and radar-detected weather near the address, not an inspection or a damage assessment. Paid report: $0.05 per line, $10 minimum.

curl -s -G https://data.truefixr.com/v1/data \
  -d dataset=history \
  --data-urlencode "address=891 Lake Hollow Blvd SW, Marietta, GA 30064" \
  -d date_of_loss=2026-04-14
response, trimmed
{
  "geocoded_address": "891 Lake Hollow Blvd SW, Marietta, GA 30064, USA",
  "radius_mi": 5.0,
  "real_line_count": 362,
  "estimated_cost_usd": 18.1,
  "date_of_loss": "2026-04-14",
  "date_of_loss_supported": false,
  "answer": "No severe-weather event is on file within 5.0 miles of this address on 2026-04-14."
}

05 / RECIPE

ML Storm Forecast by Address, 24 hours to 10 days

Free preview, paid pull needs a key

ML Storm Forecast by Address (dataset=risk) uses a separate machine-learning model for each of 10 perils. A paid pull returns addresses in the forecast footprint, each with structure replacement value (not market value), people, storm type, forecast time and a risk label. Forecasts show what could happen, not what will. The calls below show the free county grade teaser and the paid county forecast status batch, a county-level screen, not an address-level forecast.

Address-level paid pull: dataset=risk with addresses=true, $0.05 per address, windows 24h, 48h, 3d, 5d, 7d, 10d, add limit=10 for a 50 cent sample. Free: dataset=address returns current_forecast_risk, and dataset=risk without addresses returns the preview. Batch: POST /v1/portfolio/risk, $0.05 per location, up to 500 per call. Forecasts refresh 4 times a day; check data_age_hours.

# free: this address's past events plus the county forecast grade
curl -s -G https://data.truefixr.com/v1/data -d dataset=address -d lat=32.78 -d lon=-96.80

# free: ML Storm Forecast by Address preview for a window (24h, 48h, 3d, 5d, 7d, 10d)
curl -s -G https://data.truefixr.com/v1/data -d dataset=risk -d county=Dallas -d state=TX -d window=10d

# paid (needs a key): $0.05 per location
curl -s -X POST https://data.truefixr.com/v1/portfolio/risk \
  -H "Authorization: Bearer $GETFIXN_KEY" -H "Content-Type: application/json" \
  -d '{"locations":[{"lat":32.78,"lon":-96.80,"label":"Dallas yard"}],"window":"10d"}'
response, trimmed
{
  "dataset": "address",
  "matched_by": "lat/lon (~150m radius)",
  "storm_event_count": 297,
  "current_forecast_risk": { "grade": "B", "grade_label": "Moderate risk" }
}

06 / RECIPE

Hazard score for a property

Free preview, paid pull needs a key

One property's storm past, counted by kind of storm: events nearby since 2003. The free preview gives the counts. The paid score adds the most recent event date and the years since it, per peril.

Paid: $0.50 per property, flat, no matter how many events. Hail and wind also carry a most-severe-event size. Flood, lightning and tornado are count only.

# free preview
curl -s -G https://data.truefixr.com/v1/data -d dataset=hazard_score \
  --data-urlencode "address=891 Lake Hollow Blvd SW, Marietta, GA 30064"

# paid ($0.50, needs a key)
curl -s -G https://data.truefixr.com/v1/data -d dataset=hazard_score -d addresses=true \
  --data-urlencode "address=891 Lake Hollow Blvd SW, Marietta, GA 30064" \
  -H "Authorization: Bearer $GETFIXN_KEY"
response, trimmed
{
  "dataset": "hazard_score",
  "geocoded_address": "891 Lake Hollow Blvd SW, Marietta, GA 30064, USA",
  "radius_mi": 5.0,
  "total_events": 362,
  "by_peril": { "hail": { "event_count": 65 }, "wind": { "event_count": 123 }, "flood": { "event_count": 10 } }
}   // trimmed

07 / RECIPE

Model-Based Weather and Hourly Forecast by Address

Free, no key

Current conditions and any active severe weather alerts for a US location. The lean response is free with no key. Add hours_ahead (0 to 48) for Model-Based Hourly Forecast by Address, $0.0002 per call with details=true.

Free lean response has about 10 fields. details=true returns the full detail pull at $0.0002 per call and needs a key. Batch version: POST /v1/weather/batch, up to 500 locations, $0.0002 each. Not affiliated with NOAA or the NWS.

curl -s -G https://data.truefixr.com/v1/data -d dataset=weather -d lat=32.78 -d lon=-96.80
# 6 hours ahead (hours_ahead is 0 to 48)
curl -s -G https://data.truefixr.com/v1/data -d dataset=weather -d lat=32.78 -d lon=-96.80 -d hours_ahead=6
response, trimmed
{
  "location": { "lat": 32.784859, "lon": -96.802979 },
  "alerts": [],
  "nowcast": { "precip_rate_inhr": 0.051, "raining_now": true, "source": "precipitation nowcast" },
  "wind_gust_mph": 13.7615,
  "temperature_f": 72.4259,
  "humidity_pct": 91.8,
  "billed": false
}

08 / RECIPE

Batch a CSV of locations

Free preview, paid pull needs a key

Save your places as a CSV with lat, lon and label columns and send up to 500 rows per call. The script prints the row count and the price first, and only pays when you add --go.

POST /v1/weather/batch is $0.0002 per location. POST /v1/portfolio/risk is $0.05 per location. Max 500 locations per call, so split bigger files. The paid half needs GETFIXN_KEY. The response shape (results list) comes from the API's own documentation; check one small call before a big file.

curl -s -X POST https://data.truefixr.com/v1/weather/batch \
  -H "Authorization: Bearer $GETFIXN_KEY" -H "Content-Type: application/json" \
  -d '{"locations":[{"lat":30.27,"lon":-97.74,"label":"Austin office"},{"lat":32.78,"lon":-96.80,"label":"Dallas yard"}]}'
response, trimmed
{
  "results": [
    { "lat": 30.27, "lon": -97.74, "county": "Travis", "state": "TX", "grade": "B" }
  ]
}   // portfolio/risk shape from the API docs. Paid calls were not run for this page.

09 / RECIPE

Errors, 402 balance-low and spend caps

Free, no key

A paid call without a valid key or enough balance does not return 401. It returns 402 with the price in the body. Catch it, stop, and tell the user to top up. There is no cursor in the API: size your pulls with limit and narrow with filters.

400: missing or bad parameter, read detail. 402: payment required, the price is accepts[0].amount in atomic USDC (divide by 1,000,000). 422: wrong type, see loc. 429: more than 60 free previews a minute per IP. This snippet is safe to run: the unpaid batch call is refused before anything is charged.

# an unpaid paid-route call: HTTP 402 and the price, nothing is charged
curl -s -w "\nHTTP %{http_code}\n" -X POST https://data.truefixr.com/v1/weather/batch \
  -H "Content-Type: application/json" -d '{"locations":[{"lat":32.78,"lon":-96.80}]}'
response, trimmed
HTTP 402
{
  "x402Version": 2,
  "error": "Payment required",
  "accepts": [{ "scheme": "exact", "network": "eip155:8453", "amount": "200", "payTo": "0xFf23...", "maxTimeoutSeconds": 300 }],
  "extensions": { /* ... */ }
}
// amount "200" = $0.0002. The same object is in the PAYMENT-REQUIRED header (base64 JSON).

10 / RECIPE

Caching

Free, no key

Don't pay twice for the same answer. Forecasts refresh 4 times a day and live weather hourly, so even a short cache saves calls. Key the cache on the full request URL.

Pick a time-to-live that matches the data: minutes for weather, an hour or more for county forecast grades, a day for history. Cache only what your terms allow you to store.

# reuse a saved answer if it is under 60 minutes old
f=/tmp/dallas-risk.json
if [ -z "$(find "$f" -mmin -60 2>/dev/null)" ]; then
  curl -s -G https://data.truefixr.com/v1/data -d dataset=risk -d county=Dallas -d state=TX -o "$f"
  echo "fetched"
else
  echo "from cache"
fi
head -c 200 "$f"; echo
response, trimmed
first call:  fetched from the API
second call: served from cache (0 requests, $0)

11 / RECIPE

Simple rate limiting

Free, no key

Free previews are limited to 60 requests a minute per IP address. If you loop over many places, add a delay so you never see a 429. One call a second stays well under the limit.

A key is not subject to the free-preview limit in the docs, but a delay is still polite and makes costs easy to watch. If you do get a 429, wait a minute and retry (see the errors recipe).

for state in TX FL GA; do
  curl -s -G https://data.truefixr.com/v1/data -d dataset=coverage -d state=$state | head -c 60; echo
  sleep 1          # one call per second
done
response, trimmed
TX 254 counties with storm data
FL 67 counties with storm data
GA 157 counties with storm data   // one call per second

12 / RECIPE

Kalshi-style weather contracts: a signals file for your own model

Free, no key

Pull the forecast and live weather for the cities you trade and write one CSV row per city. Your model reads the file. This recipe has no order code in it and never will. It only fetches weather.

Per city it saves temperature, rain and gusts now, 24 hours out and 48 hours out (hours_ahead, a point forecast), the number of active severe alerts, and the county storm grade for 24h and 48h. Swap in the coordinates of the stations or cities your contracts name. A contract settles on whatever source its rules name, so read those rules. Our numbers are an input to your model, not the settlement source. About 1 second between calls, so 4 cities take under a minute. Everything here is on the free tier, so it costs nothing.

GetFixn sells data, not trading advice. Nothing here is investment advice. Forecasts can be wrong. You are responsible for your own strategies and for following the rules of any exchange or market you use. No exchange endorses or partners with GetFixn.

# one city, three forecast hours. Loop over your own cities in the shell.
for h in 0 24 48; do
  curl -s "https://data.truefixr.com/v1/data?dataset=weather&lat=40.78&lon=-73.97&hours_ahead=$h" \
    | python3 -c 'import sys,json; w=json.load(sys.stdin); print(w["valid_time"], w["temperature_f"], w["precip_in"], w["wind_gust_mph"])'
  sleep 1
done
curl -s "https://data.truefixr.com/v1/data?dataset=risk&lat=40.78&lon=-73.97&window=24h" \
  | python3 -c 'import sys,json; print("storm grade 24h:", json.load(sys.stdin)["grade"])'
signals.csv, sample run
city,lat,lon,temp_f_0h,precip_in_0h,gust_mph_0h,temp_f_24h,precip_in_24h,gust_mph_24h,temp_f_48h,precip_in_48h,gust_mph_48h,alerts_now,storm_grade_24h,storm_grade_48h
NYC,40.78,-73.97,68.4131,0.0,15.4228,57.5035,0.0024,23.442,54.0588,0.2173,9.435,0,A,A
CHI,41.88,-87.63,59.9756,0.0,9.6906,54.691,0.0,16.7311,53.8338,0.0,16.2856,0,A,A
MIA,25.79,-80.29,83.8256,0.0,14.0247,78.4285,0.0,11.5582,76.4463,0.0,6.7786,0,A,A
AUS,30.27,-97.74,74.2631,0.0072,18.4986,72.466,0.0547,20.6458,65.8713,0.0772,15.7264,0,A,A

13 / RECIPE

Agent pays per call in USDC (x402)

The 402 check is free

A bot with a wallet can skip the key. It calls a paid route, gets a 402 with the price, pays in USDC on Base, retries and gets the data. No signup, no balance to top up. The first payment settles right away and later small calls add up on a $1.00 tab.

The command shows the 402 and nothing is charged. A working Python client, the payable routes and wallet advice are in the docs. The agents page has the longer walkthrough and x402.html explains the protocol. Use a small separate wallet. Not investment advice, and no profit claims from us.

curl, see the 402
curl -i -X POST https://data.truefixr.com/v1/weather/batch \
  -H "content-type: application/json" \
  -d '{"locations":[{"lat":32.78,"lon":-96.80}]}'
what comes back, trimmed
HTTP/2 402
payment-required: eyJ4NDAy...   // base64 JSON, same object as the body
{ "x402Version": 2, "error": "Payment required", "accepts": [{ "amount": "200", "network": "eip155:8453", ... }], ... }

DOWNLOADS

Or skip the typing.

These files were run against the live free endpoints. The starter kit has scripts in three languages and a single-file web app that uses your own key.

FileWhat it is
getfixn-starter-kit.zipPython, Node and curl scripts, the web app and a README. One download.
webapp/index.htmlStorm Lookup in one file: weather, property history, county forecast grade, top-counties board. Your key stays in your browser.
README.mdSetup, what is free, what costs money, and how the paid scripts protect you.

Storm data means reported and radar-detected events matched to addresses. It is not an inspection or a damage assessment. Forecasts show what could happen, not what will, and can be wrong. Code is provided as is. You are responsible for your own app and for the cost of the paid calls you make. GetFixn sells data, not trading advice. Nothing here is investment advice.