Api Setup


Sports API Hub connects to external sports data APIs via RapidAPI. Before you can import any data, you need a RapidAPI account, an API subscription, and your API key entered in the plugin settings.

Admin Menu: API & Import > API Config

Step 1: Create a RapidAPI Account

  1. Go to rapidapi.com and sign up for an account
  2. Verify your email address
  3. Add a payment method (required even for free plans)

RapidAPI is a marketplace that hosts the sports data APIs used by this plugin. Your API key and billing are managed through RapidAPI, not through our plugin.

📡 Step 2: Subscribe to an API

The plugin supports three API providers on RapidAPI. Choose one based on the sports you need:

ProviderSportsRequests
AllSportsAPI2Basketball, Baseball, Cricket, Rugby, Ice Hockey, American Football, Handball, VolleyballUnlimited on Pro plan ($19.99/mo)
BasketAPI1Basketball onlyLimited (15,000-50,000/day)
BaseballAPIBaseball onlyLimited (15,000-50,000/day)

All three providers share the same endpoint structure and data format. The only difference is the host URL, sport coverage, and pricing.

AllSportsAPI2 pricing page on RapidAPI showing the Pro plan with unlimited daily requests highlighted

Recommendation

Use AllSportsAPI2 — it is the recommended provider. The Pro plan ($19.99/mo) offers unlimited daily requests across all 8 sports, making it the best value for any site.

The dedicated sport APIs (BasketAPI1, BaseballAPI) have limited daily requests on most plans. They are suitable for covering a few seasons of a single sport, but not for large-scale ongoing data sync. Only the most expensive plans on these APIs offer unlimited requests.

BasketAPI1 pricing page on RapidAPI showing limited daily requests on lower-tier plans
BaseballAPI pricing page on RapidAPI showing limited daily requests on lower-tier plans

Subscribing

  1. Search for the provider name on RapidAPI (e.g., “AllSportsAPI2”)
  2. Click Subscribe on the API page
  3. Select a pricing plan

Free Plan is NOT Suitable

Important

The free plan (Basic) on these APIs has a hard limit of 50-100 requests per day. This is not enough even for a basic import of one league — a single season import requires thousands of API calls. You must subscribe to a paid plan (Pro or higher) to use Sports API Hub effectively.

Step 3: Find Your API Key

  1. Go to your RapidAPI Dashboard
  2. Navigate to the Security or API Keys section
  3. Copy your Default Application API key

The key is a long alphanumeric string. You use the same key for all three providers — it is tied to your RapidAPI account, not to a specific API.

🔑 Step 4: Enter the API Key in the Plugin

  1. In WordPress admin, go to API & Import > API Config
  2. Paste your API key in the API Key field
  3. Select your API Provider from the dropdown (AllSportsAPI2, BasketAPI1, or BaseballAPI)
  4. Click Test Connection
API Config page showing the API Key input field, Provider dropdown set to AllSportsAPI2, and Test Connection button

Test Connection

The Test Connection button sends a test request to the API using your key and selected provider. Results:

ResultMeaning
Green checkmark with provider nameConnection successful, key is valid
Error messageKey is invalid, subscription expired, or provider mismatch

Important: The provider setting is global — it applies to all sports. You cannot use AllSportsAPI2 for basketball and BaseballAPI for baseball simultaneously. Pick one provider and use it for everything.

⚙️ Step 5: Select Sports and Review Settings

After a successful connection test:

  1. In the Sports section, check the sports you want to enable
  2. Review the import and sync settings below the sports checkboxes
  3. Click Save Settings

Available sports depend on your provider. AllSportsAPI2 offers all 8 sports. BasketAPI1 offers only Basketball. BaseballAPI offers only Baseball.

SportAllSportsAPI2BasketAPI1BaseballAPI
BasketballYesYes
BaseballYesYes
CricketYes
RugbyYes
Ice HockeyYes
American FootballYes
HandballYes
VolleyballYes
API Config page showing enabled sports checkboxes and import settings below for review before saving

Tip

Enable only the sports you actually need. Each enabled sport adds filters and options to the admin interface. You can always enable more sports later.

Step 6: Save and Verify

  1. Click Save Settings at the bottom of the page
  2. Confirm the green success message appears
  3. The Import and Custom Logos submenus now appear under API & Import

Your API connection is ready. The next step is to import data.

API Key Security

Your API key is stored in the WordPress database as a plugin option. It is never exposed on the frontend or in page source code. All API requests are made server-side from your WordPress installation.

  • Do not share your API key publicly
  • If you suspect your key has been compromised, regenerate it on the RapidAPI dashboard
  • Each RapidAPI account has its own rate limits and billing — do not share keys across multiple WordPress sites unless you are monitoring usage carefully

Rate Limits and Costs

The API enforces rate limits at two levels:

LevelLimitWhat Happens
Per-second5 requests/secondExcess requests receive a 429 error (auto-retried by the plugin)
Per-dayVaries by plan (100 for free)Excess requests blocked until daily reset

The plugin handles per-second throttling automatically — it waits and retries. When the daily limit is reached, the plugin stops making requests and reports the limit. It will not continue burning through calls.

For more detail on monitoring usage and estimating costs, see API Usage (in the Import & Sync section).

Troubleshooting

IssueSolution
Test Connection failsVerify the key has no leading/trailing spaces. Check that your RapidAPI subscription is active
“Subscription required” errorSubscribe to the API on RapidAPI — a paid plan is required for actual usage
Provider mismatchEnsure the selected provider matches your RapidAPI subscription (e.g., do not select BasketAPI1 if you subscribed to AllSportsAPI2)
No sports available to selectTest the connection first — sport checkboxes appear after a successful test

Related

  • First Import — Import your first league after API setup
  • API Config — Full API Config page reference (import options, media, live, sync)
  • API Usage — Rate limits, cost estimation, and monitoring
  • Sports — Sport-by-sport capabilities and features