How to Obtain a Kaggle API Key

This tutorial provides a step-by-step guide to obtaining a Kaggle API key.

Christian Mills


May 17, 2023


In this tutorial, I will guide you step-by-step to obtain a Kaggle API key, which you will need to access and download datasets from Kaggle using their API. This tutorial is suitable for beginners, even those who do not have a Kaggle account yet.

Create a Kaggle Account

  1. Visit Kaggle’s website at


  2. Click on the Register button at the top-right corner of the page.


  3. Select the Register with your email option. Alternatively, you can sign up using Google, Facebook, or Yahoo accounts.


  4. Fill in the required information, including your name, email, and password, then click Next.


  5. Click I agree to accept the Privacy and Terms agreement.


  6. Kaggle will email a six-digit code to verify your email address. Enter the code in the prompt and click Next to complete your account registration.


Sign in to Kaggle

  1. If you aren’t already signed in, click the Sign In button at the top-right corner of the Kaggle homepage.


  2. Select the Sign in with your email option. Alternatively, you can sign in using Google, Facebook, or Yahoo accounts.


  3. Enter your email/username and password, then click Sign In.


Access your Kaggle Account Settings

  1. Click on your profile picture at the top-right corner of the page.


  2. In the popout menu, click the Settings option.


Generate Your Kaggle API Key

  1. Scroll to the API section in your Account settings and click the Create New API Token button.


  2. Kaggle will generate a JSON file named kaggle.json and prompt you to save the file to your computer.


  3. Download the kaggle.json file and save it to a secure location on your computer. This file contains your Kaggle API key and username.

Store the Kaggle API Key

Keep the kaggle.json file safe and secure, as it contains sensitive information. Remember to set the permissions for the kaggle.json file to be readable and writable only by you. Never share this file with anyone or upload it to public repositories.

If you plan to use the Kaggle API on your local machine, ensure the kaggle.json file is in the following location:

  • Windows:

  • Linux:

  • macOS:



You have successfully obtained your Kaggle API key. You can now use it to download datasets from Kaggle using their API.

Next Steps
  • Feel free to post questions or problems related to this tutorial in the comments below. I try to make time to address them on Thursdays and Fridays.
  • If you would like to explore my services for your project, you can reach out via email at [email protected]