Api Errors


Sports API Hub connects to external sports APIs hosted on RapidAPI. When API requests fail, the plugin handles errors automatically where possible — retrying, skipping, or stopping gracefully. This page explains each error type, what causes it, and what you can do about it.

Error Code Reference

Error CodeMeaningAutomatic HandlingWhat To Do
401 UnauthorizedInvalid or missing API keyNone — request failsVerify your API key in API & Import > API Config and check your RapidAPI subscription is active
403 ForbiddenSubscription inactive or endpoint not included in planNone — request failsRenew or upgrade your RapidAPI subscription
429 Too Many Requests (per-second)Too many requests in one secondWaits 1 second, retries onceNo action needed — handled automatically
429 Too Many Requests (daily limit)Daily request quota exhaustedStops the current batch/taskWait until tomorrow (limits reset at midnight UTC) or upgrade your API plan
204 No ContentNo data available for this requestTreated as empty resultNormal response — occurs for finished seasons, future fixtures, or endpoints with no data
500 Internal Server ErrorAPI provider server errorRetries once after delayWait a few minutes and retry. This is an issue on the API provider’s side, not the plugin
TimeoutConnection to API timed outWaits 2 seconds, retries onceCheck your server’s internet connectivity. If persistent, contact your hosting provider

The 204 response is not an error — it simply means no data exists for that request. You will see this for finished seasons when requesting next fixtures, or for endpoints that have no data for a particular league.

Rate Limit Handling

The plugin uses a reactive rate-limiting strategy — it does not pre-throttle requests, but handles rate limit errors inline as they occur.

Per-Second Rate Limits

When the API returns a 429 error but the daily quota still has remaining requests, it means too many requests were sent within one second.

What happens: The plugin automatically waits 1 second and retries the request once. If the retry also fails, the individual item is skipped and the batch continues.

You do not need to take any action — this is handled transparently.

Daily Rate Limits

When the API returns a 429 error and the daily quota shows 0 remaining requests, the daily limit has been reached.

What happens: The plugin stops the current import/sync task immediately and returns a “daily limit” error. No further API calls are made until the quota resets.

What to do:

  1. Wait until the next day — daily limits reset at midnight UTC.
  2. If you frequently hit the daily limit, consider upgrading to a RapidAPI plan with a higher quota. Daily limits depend on your RapidAPI subscription plan.
  3. Reduce API usage by disabling import sub-options you do not need (lineups, incidents, highlights) in API & Import > API Config > Import Options.

Checking Your Usage

Visit your RapidAPI Dashboard to see:

  • Current daily usage vs. limit
  • Historical usage patterns
  • Available plan upgrades

🌐 Network and Timeout Errors

Connection Timeout

The plugin uses a 15-second timeout for each API request. If the API does not respond within that window, the request is considered timed out.

What happens: The plugin waits 2 seconds and retries the request once. If the retry also times out, the item is skipped.

Common causes:

  • Slow outbound HTTP connections from your server (common on shared hosting)
  • Temporary API provider latency or maintenance
  • Firewall or security plugin blocking outbound requests

What to do:

  1. Retry the operation — timeouts are often temporary.
  2. Check that your hosting provider allows outbound HTTPS connections to *.p.rapidapi.com.
  3. If timeouts are frequent, contact your hosting provider about outbound connection performance.

SSL/TLS Errors

If you see SSL-related errors, your server’s SSL certificates may be outdated.

What to do: Ask your hosting provider to update the server’s CA certificate bundle.

🔄 Import-Specific Error Behavior

During batch imports (finished games, rosters, teams, etc.), errors are handled per-item:

ScenarioBehavior
Single game fails to fetchLogged, skipped — import continues to next game
Single team fails to fetchLogged, skipped — import continues to next team
Per-second rate limit hitAuto-retry after 1 second
Daily limit reachedEntire import task stops — can be resumed tomorrow
API returns unexpected dataLogged, item skipped — import continues

The import system is designed to be resilient. A failure on one item does not stop processing of the remaining items in the batch — only daily limit exhaustion stops the entire task.

Testing Your API Connection

You can test your API connection directly from the plugin:

  1. Navigate to API & Import > API Config.
  2. Enter your API key and select your provider.
  3. Click the Test Connection button in the sticky bar at the bottom.

The test makes a single lightweight API call to verify your key is valid and the API is reachable. It reports success or the specific error encountered.

Manual Testing with curl

For advanced debugging, you can test the API directly from your server’s command line:

curl -s -o /dev/null -w "%{http_code}" \
  -H "x-rapidapi-host: allsportsapi2.p.rapidapi.com" \
  -H "x-rapidapi-key: YOUR_API_KEY" \
  "https://allsportsapi2.p.rapidapi.com/api/basketball/tournament/all"

Replace YOUR_API_KEY with your actual key. A 200 response means the connection is working. Any other code indicates the specific error (see the error code reference table above).

Important: Use x-rapidapi-host and x-rapidapi-key headers (not x-api-host or x-api-key). Using the wrong header names is a common mistake that results in 401 errors.

Checking Import Logs

The plugin tracks import progress for troubleshooting:

  1. Navigate to Hub Data > Games in the WordPress admin.
  2. Use the Import Status filter to find games with specific statuses.
  3. Games that failed during import will show their status in the list table.

Import status values:

StatusMeaning
FixtureGame scheduled, no details imported yet
DetailedFull game details successfully imported
RecheckedGame re-updated after initial import
SkippedGame skipped during import (e.g., postponed, cancelled)

When to Contact Support

Contact support if:

  • You receive persistent 401 or 403 errors after verifying your API key and subscription.
  • Timeouts occur consistently and your hosting provider confirms no connectivity issues.
  • Import produces unexpected results even though the API returns valid data.
  • You see errors not listed on this page.

When contacting support, include the error code, the operation you were performing (import, sync, live scores), and any console or log output. This helps us diagnose the issue faster.

📚 Related