Prerequisites to use the public API
You need to have a valid Keyword Insights subscription in order to use the public API. Before using the public API, you must acquire a Bearer token for authentication so that our servers can verify who you are and that you have permission to use the API.How to use the interactive public API documentation
To use the Swagger UI interactively, you must first be authenticated.Follow the instructions below to generate a Bearer token. Once you are authenticated, you can Try it out on any endpoint by providing your Bearer token and the required parameters.
Authenticate and retrieve a Bearer token (email and password)
This approach is for users who signed up with an email and password (not via Google Sign In).If you signed up with Create with Google, use the Google Sign In approach in the next section instead:
How to authenticate with the public API and retrieve a bearer token? (Google Sign In Approach)
- Open the API documentation, scroll to the bottom of the page, and locate the Authentication section.

Authentication → /authentication/login You should now see the authentication request details, including a Try it out button.
.png?fit=max&auto=format&n=jBGkmInQA6GjnN58&q=85&s=731720274aaa8cf14d7962efcd1fe164)
- After clicking Try it out, the request body field becomes editable.
- Enter your valid email address and password, exactly as you would on
app.keywordinsights.ai. - Click the large blue Execute button below the text field.
- Enter your valid email address and password, exactly as you would on
.png?fit=max&auto=format&n=jBGkmInQA6GjnN58&q=85&s=b8525666badf934de7ff91eb0a92b541)
result object.
- In the response, copy the value of the
access_token.
In the example below, the token starts witheyJ0....and ends with...Mokg. You will need this token in the next step.
.png?fit=max&auto=format&n=jBGkmInQA6GjnN58&q=85&s=6916d7b02176981c15b06e9e61074119)
- In a text editor of your choice, paste the copied access token and prepend the word
Bearer(with a capital B), separated by a single space.
Your complete string should look similar to:
Bearer) is what you will use as the Authorization header for any authenticated API request.Some endpoints also require additional arguments such as
order_id, which you can usually find in the URL of the respective page in the application.
- Validate your Bearer token using the steps in the section
Validate your Bearer Token.
Authenticate and retrieve a Bearer token (Google Sign In)
Use this approach if you signed up using Create with Google instead of creating a password during sign up. If you signed up manually with an email and password, use the previous section instead:How to authenticate with the public API and retrieve a bearer token? (Email and password approach)
- In your browser of choice (Chrome in this example), open a new tab and open the Network tab in the developer tools.
.png?fit=max&auto=format&n=jBGkmInQA6GjnN58&q=85&s=d226882898d6b21e53b338221c6a7d87)
.png?fit=max&auto=format&n=jBGkmInQA6GjnN58&q=85&s=39d0fc655ea347ecc49aaba9a09e61f3)
- In the address bar, navigate to https://app.keywordinsights.ai.
Before logging in, click the clear button in the Network tab so that you can easily see only the upcoming requests.
.png?fit=max&auto=format&n=jBGkmInQA6GjnN58&q=85&s=3a736c90c3062e851cdd1f953e902028)
- Click LOG IN WITH GOOGLE and follow the prompts in the pop-up window as you normally would when signing in to the application.
-
After you are logged in, go back to the Network tab and locate a successful request (for example, the
/userrequest – but any authenticated request will work).- Select the request.
- In the right-hand panel, make sure the Headers tab is selected.
- Scroll down until you find the Authorization header.
- Copy the entire value of the Authorization header, including the word
Bearer.
.png?fit=max&auto=format&n=jBGkmInQA6GjnN58&q=85&s=741c60d436d9079b504c771f49be99be)
- Validate your Bearer token using the steps in
Validate your Bearer Token.
Validate your Bearer Token
To confirm that your Bearer token works correctly, you can call the User endpoint in Swagger.- In the Swagger UI, navigate to the User endpoint and click Try it out to make the input fields editable.
- Paste the full Bearer token string (including the word
Bearer) into the appropriate field. - Click the large blue Execute button.
.png?fit=max&auto=format&n=jBGkmInQA6GjnN58&q=85&s=8623e59bd1bdc2c564c8a01464a8a4fc)
.png?fit=max&auto=format&n=jBGkmInQA6GjnN58&q=85&s=1a931cfe215e9d6199c4c7c2943711d8)
- If the Bearer token is valid, you should see a 200 response code and your user object in the response body.
.png?fit=max&auto=format&n=jBGkmInQA6GjnN58&q=85&s=d5463c25be2ec9ecb22dc0f986f59a43)