pip install topk-sdk

Setup a TopK Client

To setup a client, you’ll need your API key and region:

from topk_sdk import Client

client = Client(api_key="YOUR_TOPK_API_KEY", region="aws-us-east-1-elastica")

TopK Client accepts the following parameters:

api_key
string
required

The API key for the project.

region
string
required

The region of the project. Available regions are:

  • aws-us-east-1-elastica

Check out the Regions page for more information.

host
string
default:"topk.io"

The host of the project.

https
boolean
default:true

When using a public host this should always be true. In most cases it is used for internal purposes.

API Key

TopK API key is project-specific, so you’ll need to obtain an API key for each individual project from the TopK Console.

To obtain your API key:

  1. Go to the TopK Console.
  2. Log in or create your account
  3. Go to a project or create a new one
  4. Generate an API key and store it safely. TopK API Key can be viewed only once.

TopK follows Organization > Project > Collection hierarchical structure.

TopK with Vite/Webpack SSR

If you’re using the TopK JavaScript SDK in a server-side rendering (SSR) environment, you may need to follow these steps to ensure compatibility:

Next steps

We look forward to having you onboard. Here are some resources to help you get started: