FantasyEngine docs Fantasy Engine Data API
Version 1.0
  • 1.0 (this version)

Fantasy Engine Data API 1.0 / Start

Access, keys, limits and errors

Developer

What a plan includes, how the two keys work, the limits per key, renewing, and every error the API can answer with what to do about it.

What a plan includes#

Last updated: 2026-11-25 · v1.0

  • A plan made for Fantasy Engine sites. The Data API delivers the sports data a Fantasy Engine site runs on: teams, players, schedules, live scores, box scores and odds, through the endpoints of this guide. Using it for another kind of software needs our agreement first.
  • Every sport, one expiry. A plan opens every sport listed by /settings until one expiry date (each sport object of /settings repeats the same expire_at).
  • Free trial. The free trial gives full access to every sport for 15 days, with one key.
  • Two keys: a live key and a dev key (Live key and dev key). Both open the same data until the same expiry.
  • Limits per key (Request limits): far above what a site that polls sensibly needs. The freshness recipe says how often there is something new. The service counts the requests of each key per day for support purposes.
  • Payment with PayPal or Stripe in the shop (buy_url of /settings).
  • Your keys stay the same when you renew.

Live key and dev key#

Last updated: 2026-11-25 · v1.0

  • Live key (starts with fe_live_): for your production site.
  • Send a key exactly as you got it. A fe_live_ / fe_dev_ key is matched letter for letter: the same key in other letter case is refused (401).
  • Dev key (starts with fe_dev_): for your local and staging sites (localhost, 127.0.0.1, a test domain). Same data, lower limits, its own usage line, so tests never eat into your live site's limits.
  • A key is shown once. Keys are stored hashed: the shop and support show a key in full only when it is created or replaced. Store it in your site's settings (never in a public page or repository). A lost key cannot be shown again: ask support for a new one - the old one stops working at once (401).
  • Tell us which site calls (optional, recommended): send X-Site-Url: https://<your site> and a User-Agent that names your software (a Fantasy Engine site sends FantasyEngine/<version> by itself). Both are recorded with the key's usage to help support; they never open or close access.
  • One live key, one site. A live key used from many IP addresses or sites in one day is reported to support, who will contact you. A site behind several servers is fine - tell support, or ask for an IP lock.
curl -H "X-API-KEY: YOUR_DEV_KEY" -H "X-Site-Url: http://localhost:8080" \
     -H "User-Agent: MySite/2.1" https://data.fantasyengine.net/api/feeds/settings

Request limits#

Last updated: 2026-11-25 · v1.0

KeyPer minutePer 24 hours
live300no limit
dev305 000 (24 hours from the first request of the window)
  • Every request with the key counts, /settings too; a refused request (429) does not count.
  • Above a limit the answer is 429 with a Retry-After header: the seconds until the window that refused it ends. Wait that long, then go on; do not retry in a loop.
  • For scale: a Fantasy Engine site makes at most about 20 requests a minute on a busy match day, about 3 000 a day.
HTTP/1.1 429 Too Many Requests
Retry-After: 40
{"error":{"code":"too_many_requests","message":"Too many requests for this API key in 1 minute. Try again later.","detail":[],"headerCode":429}}

IP lock (optional)#

Last updated: 2026-11-25 · v1.0

On request, support locks a key to the IP addresses or ranges (CIDR, for example 203.0.113.0/24) of your server. A request with that key from any other address is refused with 403 This API key is not allowed from this IP address. Only for a server with a fixed outgoing address (not for shared hosting whose address changes); keep the dev key unlocked for local work.

Lock only to your server's outgoing IP address - the address it calls out from, which can differ from the address your site name points to (ask your host if unsure). An IPv4 address also matches when your server reaches the service over IPv6 in the IPv4-mapped form (::ffff:203.0.113.9).

Expiry and renewal#

Last updated: 2026-11-25 · v1.0

  • Access ends at the instant expire_at (UTC). From then on the sport endpoints answer 403 Data feed expired. /settings and /pricing keep answering, so your program can read expire_at / is_expired and warn you.
  • You receive reminder e-mails 7 days and 1 day before the expiry.
  • Renew in the shop (buy_url of /settings; read it from /settings, the shop address can change) and pay with PayPal or Stripe. A renewal bought while the key still runs adds its months to the current expiry; one bought after the expiry counts from the purchase. The new expiry shows in /settings at once; nothing changes in your program.
  • A key can also be switched off by us (for example after a refund) or replaced; it then answers 401 like an unknown key. Contact support if that happens unexpectedly.

Errors#

Last updated: 2026-11-25 · v1.0

Every refusal has the same shape and a real HTTP status; headerCode repeats the status:

{"error": {"code": "error", "message": "Invalid api key", "detail": [], "headerCode": 401}}
HTTPerror.codeerror.messageWhenWhat to do
401errorInvalid api keyno X-API-KEY header, an unknown key, a replaced (rotated) key, or a key switched off by us. Also on /settings and /pricing.Check the header name and value (no spaces, no quotes). Do not retry in a loop: wrong keys are rate limited (below).
403errorThis API key is not allowed from this IP addressthe key is locked to IP addresses and the request came from another one.Call from the locked server, or ask support to change the list.
403errorData feed expiredthe key is valid but its expire_at has passed.Renew; read /settings to see the date.
403errorYou need to buy data feed firstthe account has a key but never bought a period.Buy a plan in the shop.
404errorSport not foundthe sport key in the path is unknown or switched off.Use a key from /settings.
404errorFixture not found/stats/{id} or /odds/{id} with an id that is not a fixture of THAT sport (or not a number).Use the fixture id from the same sport's schedule.
404errorTeam not found/players/{team_id} with a team of another sport.Use an id from the same sport's /teams.
404not_foundThe route api/feeds/... could not be found.a path under /api/feeds/ that is not an endpoint (typo).Check the path.
404not_foundApi not founda path outside /api/feeds/ (for example /api/feed/settings), whatever the method.Every endpoint starts with /api/feeds/.
405method_not_allowedThe POST method is not supported for route api/feeds/... Supported methods: GET, HEAD.an endpoint asked with another method than GET; the Allow header lists the methods.Send a GET.
400error_validatethe first problem, e.g. The from value must be a date in the format Y-m-d (UTC).a schedule filter that cannot be read (Schedules); detail holds one message per parameter.Fix the parameter. A filter is never ignored silently.
429too_many_requestsToo many requests for this API key in 1 minute. Try again later. / The daily request limit of this API key is reached. Try again later.the key went over its limit.Wait the seconds of the Retry-After header, then go on.
429too_many_requestsToo many requests in 1 minute. Try again later.more than 30 requests in a minute from one IP address without a valid key.Fix the key, then wait a minute.
5xx--a server problem or maintenance.Retry later with a growing pause (for example 5 s, 15 s, 60 s); keep using the data you have.

Example answers (status line + body):

GET /api/feeds/epl/teams                      (no X-API-KEY header)
HTTP/1.1 401 Unauthorized
{"error":{"code":"error","message":"Invalid api key","detail":[],"headerCode":401}}

GET /api/feeds/xyz/teams
HTTP/1.1 404 Not Found
{"error":{"code":"error","message":"Sport not found","detail":[],"headerCode":404}}

GET /api/feeds/epl/stats/489                  (489 is an NBA game)
HTTP/1.1 404 Not Found
{"error":{"code":"error","message":"Fixture not found","detail":[],"headerCode":404}}

GET /api/feeds/epl/players/47                 (47 is not an EPL team)
HTTP/1.1 404 Not Found
{"error":{"code":"error","message":"Team not found","detail":[],"headerCode":404}}

GET /api/feeds/epl/nothing
HTTP/1.0 404 Not Found
{"error":{"code":"not_found","message":"The route api\/feeds\/epl\/nothing could not be found.","detail":[],"headerCode":404}}

GET /api/feed/settings
HTTP/1.1 404 Not Found
{"error":{"code":"not_found","message":"Api not found","detail":[],"headerCode":404}}

POST /api/feeds/epl/teams
HTTP/1.0 405 Method Not Allowed
Allow: GET, HEAD
{"error":{"code":"method_not_allowed","message":"The POST method is not supported for route api\/feeds\/epl\/teams. Supported methods: GET, HEAD.","detail":[],"headerCode":405}}

GET /api/feeds/epl/schedule?from=17.10.2026
HTTP/1.1 400 Bad Request
{"error":{"code":"error_validate","message":"The from value must be a date in the format Y-m-d (UTC).","detail":{"from":"The from value must be a date in the format Y-m-d (UTC)."},"headerCode":400}}

GET /api/feeds/epl/schedule?from=2026-10-20&to=2026-10-10&round=0
HTTP/1.1 400 Bad Request
{"error":{"code":"error_validate","message":"The to date must be on or after the from date.","detail":{"to":"The to date must be on or after the from date.","round":"The round must be a whole number from 1 to 999."},"headerCode":400}}

403 and 429 answers have the same envelope with the messages of the table (403: {"error":{"code":"error","message":"Data feed expired","detail":[],"headerCode":403}}; 429: {"error":{"code":"too_many_requests","message":"Too many requests in 1 minute. Try again later.","detail":[],"headerCode":429}}). They are read from the code.

Order of the checks#

Last updated: 2026-11-25 · v1.0

For a sport endpoint the service checks, in this order: the path and method (404 / 405); then, for a request without a valid key, the per-IP limit of 30 a minute (429 Too many requests in 1 minute. Try again later.) - so a client sending a wrong key gets 429 instead of 401 once it is over that limit -; the key (401), the IP lock (403), the key's limit (429), the sport (404), the purchase and expiry (403), the fixture or team id of the path (404). Read error.message when you need to tell two refusals with the same status apart.

Change log#

Last updated: 2026-11-25 · v1.0

Date (GMT+7)SectionWhat changed
2026-10-27allFirst version of the Data API reference (a single document), every example answer taken from a test copy of the API.
2026-10-28 to 2026-10-30allRe-checked with every API change of those days (see the API history).
2026-11-25allMoved to the documentation site as this page; every section re-checked against the code of version 1.0 of the Data API (endpoints, parameters, defaults, allowed values, paging, errors, limits, the X-API-KEY header, times in UTC). New section "What a plan includes" (a plan made for Fantasy Engine sites, every sport until one expiry, the 15-day free trial of one sport, payment with PayPal or Stripe); notes for keys from before the two-key update taken out; example error answers taken again (same bodies).
2026-11-25What a plan includesFree trial: full access to every sport for 15 days with one key (it said one sport).
2026-11-25ErrorsNew row and example: a path outside /api/feeds/ answers 404 not_found Api not found, whatever the method. Errors checked again against the live API.