Download Markdown

Data Access Path · 1/7

Recommended reading order, not completion status. Optional steps can be skipped.

View all steps

Before you start: Have an organization account or contact its administrator; with an existing key, configure the environment without signing into the console again.

Get an API Key

By the end of this page you will have an API key and have configured it safely.

Each API key belongs to an application, not to a person. It only calls the API; it can’t sign in to the console.

Get a key

Your situationWhat to do
You are an owner or admin of the organizationSign in to the console, pick or create an application, and generate a key under “Application keys”
You don’t have admin rightsTell your organization admin which platforms, fields and use you need, and ask them to send you a key securely
You already have a keyGo to the next section

The full key is shown only once, when it’s created. Save it right away.

Configure it in your program

All examples use two environment variables: WHALE_BASE_URL and WHALE_API_KEY.

Type the key in interactively so it doesn’t end up in your shell history:

Bash
export WHALE_BASE_URL="https://www.marsyoo.com"
read -r -s -p "API Key: " WHALE_API_KEY
printf '\n'
export WHALE_API_KEY

On servers, inject it from a secret manager, key vault or protected environment variable.

Send the key in the request header:

HTTP
Authorization: Bearer whale_consumer_xxx

Note: Never put the key in source code, images, front-end pages or URL parameters. Log only the key prefix.

Then check it works with your first query.

Try it in the browser first

You can try the API without code in the Playground:

  1. Sign in, then choose an application and key.
  2. Choose History.
  3. Click Run request.
  • Without signing in you only see example data, marked as such.
  • Existing keys can’t be shown again. Paste the full key, or ask someone with rights to generate a test key.
  • Auto mode may generate a test key when none is available.
  • Real requests are billed like any other call.

See what you can read

Your application’s access decides which platforms and fields a key can read. See the current access and call limits on the application’s “Access limits” page in the console.

  • New applications follow the organization’s settings by default.
  • An application can be narrowed within the organization’s access, never widened.
  • A new key doesn’t change permissions.

To widen access, ask your organization admin to contact us. See Console.

Rotate and revoke

  • Use a separate key for each environment and each external system, so you can trace and revoke them.
  • To rotate: create a new key, switch traffic to it, then revoke the old one.
  • If you suspect a leak, revoke the key in the console immediately and contact us.

When something fails

An invalid key returns 401; a request outside your access returns 403. Full list: Error codes.

Completion check: Confirm effective application platforms and fields, receive a Consumer Key securely and configure your environment; never paste secrets into agent conversations.