Authentication
After completing this quick start guide you’ll have generated and tested an authentication token that can be used in all subsequent requests to the Categorization.dev API.
How to Create an Account
Navigate to the Categorization.dev Dashboard and simply follow the steps to log in or create a new account.
Retrieving a Token
After you’ve logged in to the dashboard, follow these steps to get a token:
- Click API Keys.
- Select New.
- Assign a name for the token. This helps in future referencing. You can also add notes to describe its use-case, then select Save.
A new token will be displayed in text format with a copy to clipboard button. Use this button to copy the token and secure it in a safe place.
Remember that you can view the logs and track the number of requests made on the dashboard.
Testing the Token
Once you have your token, you can test it using the Terminal. Set up the environment by entering and executing the following command. Replace <TOKEN>
with the token you’ve copied from the Categorization.dev dashboard:
export CATEGORIZATIONAPI_TOKEN="<TOKEN>"
This step eliminates the need to copy and paste the token each time it’s in use. You are now ready to make a call to the Categorization.dev Usage service. Use the following command to proceed:
curl -H "x-api-key: $CATEGORIZATIONAPI_TOKEN" https://categorization.dev/api/usage | jq .
The response should look like this:
{
"plan": "API",
"remaining": "14823"
}
This command will return the number of remaining requests under your token.
Keep in mind that most examples in this documentation assume that you have set the $CATEGORIZATIONAPI_TOKEN
variable.
Wrapping up
Congratulations! You have successfully authenticated with the Categorization.dev API using a generated token.
Was this page helpful?