Getting Started with Api-Football

Set up your credentials to get the API key for accessing the endpoints and widgets.

Before we access the Api-Football for any data, we’ll need an API key. An API key is a token that a client provides when making API calls. In this lesson, we’ll learn how to get an API key for our requests.

Create and validate your account

To get an API key for Api-Football, we first need to create an account either on the Api-Football website or the RapidAPI website. Both of these accounts have associated keys that we can use. For this course, we’ll create our account on the Api-Football website. Follow these steps to create and then validate your account:

  • Go to the Api-Football registration page.
  • Enter your credentials, and click the “Sign Up” button to create the account.
  • You’ll receive a validation link at the provided email address. Click that link to validate your account. You’ll be redirected to your dashboard.

Fetch the API key

Now that we’ve set up our account, we’ll have an associated API key that we can use with our requests. Follow these steps to get the API key:

  • Click the “Account” button in the navigation bar on the left side of the dashboard. A menu will appear.
  • Select “My Access” from the menu. This will take you to a page with all the API keys associated with your account.

The whole process has been demonstrated in the slides below:

Copy the API key and save it for use throughout this course. To save your API key, click the “Edit” button below. Enter your API key and click the “Save” button. Once you’ve saved the API key, click the “Run” button to check its validity.

Press + to interact
validateAPIKey('{{API_KEY}}'); // A function that validates the API key