Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Resolve names to IDs across competitions, teams, countries, and sports.
GET /api/v1/search?q={query}
q
sportId
filter
sports,countries,competitions,competitors
curl -H "x-api-key: YOUR_API_KEY" \ "https://api.sportsapipro.com/v1/search?q=barcelona"
{ "success": true, "type": "search", "data": { "sports": [ { "id": 1, "name": "Football", "nameForURL": "football" }, { "id": 2, "name": "Basketball", "nameForURL": "basketball" } ], "countries": [ { "id": 2, "name": "Spain", "nameForURL": "spain", "sportTypes": [1, 2, 5, 8, 9] } ], "competitions": [ { "id": 11, "name": "LaLiga", "sportType": 1, "countryId": 2 } ], "competitors": [ { "id": 132, "name": "FC Barcelona", "sportId": 1, "countryId": 2, "symbolicName": "BAR" } ] } }
# Only teams curl -H "x-api-key: YOUR_API_KEY" \ "https://api.sportsapipro.com/v1/search?q=lakers&filter=competitors&sportId=2" # Only competitions, only football curl -H "x-api-key: YOUR_API_KEY" \ "https://api.sportsapipro.com/v1/search?q=premier&sportId=1&filter=competitions"
let timer; input.addEventListener('input', () => { clearTimeout(timer); timer = setTimeout(async () => { const r = await fetch( `https://api.sportsapipro.com/v1/search?q=${encodeURIComponent(input.value)}&filter=competitors`, { headers: { 'x-api-key': KEY } } ); const { data } = await r.json(); render(data.competitors.slice(0, 8)); }, 200); });
Was this page helpful?