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

The Single-Sport APIs Charge Past Their Daily Quota

BasketAPI1, BaseballAPI and AmericanFootballApi include 15,000 requests a day on the Pro plan and 50,000 on Ultra, and RapidAPI charges for every request past that: $0.01 each on BaseballAPI and AmericanFootballApi, $0.0001 on BasketAPI1 at the time of writing (prices can change – check the current one on the BasketAPI1, BaseballAPI or AmericanFootballApi pricing page). The API keeps answering, so nothing stops at the quota – the plugin can’t stop there for you either. A big import, like several seasons in one day, can go over it. Every paid AllSportsAPI2 plan has no daily limit, which is why we recommend it.

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 four API providers on RapidAPI. Choose one based on the sports you need:

ProviderSportsRequests
AllSportsAPI2Basketball, Baseball, American Football, Ice Hockey (Rugby, Cricket, Handball and Volleyball are planned)Unlimited on every paid plan (Pro $19.99/mo)
BasketAPI1Basketball only15,000/day (Pro) or 50,000/day (Ultra), then $0.0001 per request
BaseballAPIBaseball only15,000/day (Pro) or 50,000/day (Ultra), then $0.01 per request
AmericanFootballApiAmerican Football only15,000/day (Pro) or 50,000/day (Ultra), then $0.01 per request

All four 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 every sport, and it’s the only provider for ice hockey, making it the best value for any site.

The dedicated sport APIs (BasketAPI1, BaseballAPI, AmericanFootballApi) have a daily request quota on the Pro and Ultra plans, and every request past it is billed. They are suitable for covering a few seasons of a single sport, but not for large-scale ongoing data sync. Only their Mega plan has no daily limit.

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 four 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. Select your API Provider from the dropdown (AllSportsAPI2, BasketAPI1, BaseballAPI or AmericanFootballApi)
  3. Paste your API key in the API Key field
  4. Click Save & Test Connection
API Config page showing the API Key input field, Provider dropdown set to AllSportsAPI2, and Test Connection button

Test Connection

The Save & Test Connection button saves your key and sends a test request to the API with it and the selected provider. Results:

ResultMeaning
Connection Successful with a green checkmarkYour key is valid. Click Review Settings to go on
Error messageKey is invalid, subscription expired, or provider mismatch
API Configuration wizard after a successful test: Connection Successful message with the Review Settings button

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 four available sports. Each single-sport provider offers only its own sport, and the plugin selects it for you.

SportAllSportsAPI2BasketAPI1BaseballAPIAmericanFootballApi
BasketballYesYes——
BaseballYes—Yes—
American FootballYes——Yes
Ice HockeyYes———

The sport cards also show Rugby (In Development) and Cricket, Handball and Volleyball (Planned). You can’t select those yet – see Supported Sports.

API Config Sports section: Basketball, Baseball, American Football and Ice Hockey cards can be selected, Rugby shows In Development and Cricket, Handball and Volleyball show Planned

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-second6 to 15 requests/second, depending on the planExcess requests receive a 429 error (auto-retried by the plugin)
Per-dayNone on paid AllSportsAPI2 plans. 15,000 (Pro) or 50,000 (Ultra) on the single-sport APIsSingle-sport Pro and Ultra: every request past the quota goes through and is billed ($0.01 on BaseballAPI and AmericanFootballApi, $0.0001 on BasketAPI1)

The plugin handles per-second throttling automatically (it waits and retries). It can’t stop at a daily quota the API doesn’t enforce: on the single-sport Pro and Ultra plans, requests past the quota go through and are billed. Pitch-by-Pitch Data, the heaviest option at about 70 requests per game, takes at most 50 games a day on BaseballAPI for that reason. For large imports on a single-sport API, spread the seasons over several days and keep an eye on usage in your RapidAPI dashboard.

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