{"openapi":"3.1.0","info":{"title":"FiveM.tools API","version":"1.0.0","description":"Read-only data about public FiveM servers: live player counts, IP addresses, player history and global totals. FiveM.tools tracks every public FiveM (GTA V multiplayer) server from the official Cfx.re list, refreshed every minute. To answer \"how many players are on <server>\" use search_servers with the server name, then get_server for details. To answer \"what is the IP of cfx.re/join/<code>\" use get_server, or lookup_server_ip for a live check. Always mention the data time and link the server page (url field) so the user can verify.\n\nFree, read-only, no key, no cookies. Data: official Cfx.re server list, refreshed every minute. Rate limit: 120 requests per minute per IP (429 with Retry-After when exceeded). Errors are JSON {\"error\": \"...\"}. Human docs: https://fivem.tools/developers","contact":{"url":"https://fivem.tools"}},"servers":[{"url":"https://fivem.tools"}],"paths":{"/api/v1/servers":{"get":{"operationId":"searchServers","summary":"Search FiveM servers by name, tag, locale or IP (live player counts)","parameters":[{"name":"q","in":"query","description":"Text to search (server name, tag, locale, code or IP).","schema":{"type":"string"}},{"name":"ip","in":"query","description":"Find servers by connect IPv4 (optionally :port). Exact or prefix, e.g. 172.84.94.95 or 172.84.94.95:30120.","schema":{"type":"string","pattern":"^[0-9.]+(:[0-9]{1,5})?$"}},{"name":"country","in":"query","description":"ISO country code(s), comma separated.","schema":{"type":"string"}},{"name":"tag","in":"query","schema":{"type":"string"}},{"name":"sort","in":"query","schema":{"type":"string","enum":["players","name","occupancy","upvotes"]}},{"name":"onlyWithPlayers","in":"query","schema":{"type":"boolean"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":50,"default":10}},{"name":"offset","in":"query","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"Matching servers","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Bad input, for example an invalid IP address or code","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached; retry after the Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server list still loading after a restart; retry in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Search the live Cfx.re server list. Use `ip` for a reverse IP lookup (which server runs on 46.203.182.178), `q` for a name, tag, locale, code or IP, `country` for an ISO 3166-1 alpha-2 code and `tag` for an exact tag. Sorted by players online. Paging with `limit` (max 50) and `offset`. Example: /api/v1/servers?ip=46.203.182.178 or /api/v1/servers?q=roleplay&country=TR&limit=10. HTML version: /servers?q=... and /ip/{ip}."}},"/api/v1/servers/{id}":{"get":{"operationId":"getServer","summary":"One FiveM server: players now, peak, IP and port, connect command","parameters":[{"name":"id","in":"path","required":true,"description":"Server code from the cfx.re join link (the abc123 in cfx.re/join/abc123).","schema":{"type":"string","pattern":"^[A-Za-z0-9]{1,16}$"}}],"responses":{"200":{"description":"Server","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Bad input, for example an invalid IP address or code","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Unknown server","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached; retry after the Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server list still loading after a restart; retry in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"One server by its CFX ID (the code in cfx.re/join/{id}): players now, max players, 24h and all-time peak, country, tags, IP and port, connect command, first and last seen, and `activity`: the busiest and quietest 3-hour UTC windows over the last 7 days (null when there are fewer than 3 days of data)."}},"/api/v1/compare":{"get":{"operationId":"compareServers","summary":"Compare 2 or 3 FiveM servers side by side (JSON)","description":"Side-by-side numbers for 2 or 3 servers (ids=abc123,def456). Same fields as getServer plus 24h and 7-day peak and average.","parameters":[{"name":"ids","in":"query","required":true,"schema":{"type":"string","example":"4ggmlko,zjvqmgd"},"description":"Comma-separated server codes (letters and digits)."}],"responses":{"200":{"description":"Compared servers","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Missing or invalid codes"},"429":{"description":"Rate limit reached; retry after the Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server list still loading after a restart; retry in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/servers/{id}/history":{"get":{"operationId":"getServerHistory","summary":"Player count history for one server","parameters":[{"name":"id","in":"path","required":true,"description":"Server code from the cfx.re join link (the abc123 in cfx.re/join/abc123).","schema":{"type":"string","pattern":"^[A-Za-z0-9]{1,16}$"}},{"name":"range","in":"query","schema":{"type":"string","enum":["1h","3h","6h","12h","24h","48h","72h","7d","30d","1y"],"default":"24h"}}],"responses":{"200":{"description":"History","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Bad input, for example an invalid IP address or code","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached; retry after the Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server list still loading after a restart; retry in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Player count history for one server. `range` is one of 1h, 3h, 6h, 12h, 24h, 48h, 72h, 7d, 30d, 1y. Returns points with time, average and maximum players, plus a peak/average summary."}},"/api/v1/lookup":{"get":{"operationId":"lookupServerIp","summary":"Live Cfx.re lookup: cfx.re join link or code → IP, port and players","parameters":[{"name":"server","in":"query","required":true,"description":"cfx.re/join/abc123 or abc123","schema":{"type":"string"}}],"responses":{"200":{"description":"Resolved server","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Bad input, for example an invalid IP address or code","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not listed / offline","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached; retry after the Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server list still loading after a restart; retry in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Live lookup of a cfx.re join link or code against Cfx.re (slower, stricter rate limit). Prefer getServer for servers that are already listed."}},"/api/v1/stats":{"get":{"operationId":"getGlobalStats","summary":"Total FiveM players and servers online now, top servers","parameters":[{"name":"top","in":"query","schema":{"type":"integer","minimum":1,"maximum":50,"default":10}}],"responses":{"200":{"description":"Totals","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Bad input, for example an invalid IP address or code","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached; retry after the Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server list still loading after a restart; retry in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"Total players and servers online now and the busiest servers (`top`, 1-50)."}},"/api/v1/blog":{"get":{"operationId":"listBlogPosts","summary":"FiveM guides on the FiveM.tools blog","parameters":[{"name":"lang","in":"query","schema":{"type":"string","default":"en"}}],"responses":{"200":{"description":"Posts","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"400":{"description":"Bad input, for example an invalid IP address or code","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limit reached; retry after the Retry-After seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Server list still loading after a restart; retry in a minute","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"description":"FiveM troubleshooting guides on the FiveM.tools blog, in the given language."}}},"components":{"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"What went wrong and how to fix the request."}}}}}}