liveBook · Manning

API key

As explained in Snowflake Data Engineering

An API key is a credential string supplied to an application programming interface to authenticate or authorize a request.

An API key is a credential string used to authenticate or authorize requests to an external API. API documentation specifies how to generate the key and include it when calling an endpoint. section 7.1

In Snowflake external network access, store the key in a secret rather than embedding it in procedure logic. The secret is allowed by an external access integration, which is passed to a Python UDF or stored procedure calling the API. section 7.1 section 7.5

A practical API-key integration follows these steps:

  • Read the endpoint documentation, identify the required authentication method, and obtain the key by registering an application when required. section 7.1
  • Create a Snowflake secret containing the key, then include that secret in an external access integration alongside a network rule for the API host. section 7.1
  • Grant users the required USAGE privilege on the integration and READ privilege on the secret before they call the API from Snowflake. section 7.5

Calling Yelp from Snowflake

A pipeline retrieving bakery reviews uses Yelp’s Reviews endpoint and a private API key. The key is stored as YELP_API_TOKEN, while YELP_API_NETWORK_RULE allows traffic to api.yelp.com; both are referenced by YELP_API_INTEGRATION. section 7.1

Figure 7.1 Snowflake's external network access architecture consists of a network rule pointing to an external network location and a secret containing a token, key, or password. The network rule and secret are included as parameters when creating an external access integration object. This object is passed as a parameter to a Python function or stored procedure so that the function or procedure can call the external API.
figure

Use the architecture figure to trace how the API key moves from a secret into an external access integration and then into a Python function or stored procedure. section 7.1

How Snowflake Data Engineering covers it

How deep it goes
Explains authentication, credential generation, secret storage, integration wiring, and privileges, but not key format or rotation.
Examples
Demonstrates a private Yelp key stored as YELP_API_TOKEN for the Reviews endpoint.
What it assumes
Assumes familiarity with API documentation and Snowflake roles, while explaining authentication and credential setup.
What you can do after
Operate/configure a Snowflake external API call using a secret, network rule, integration, and required privileges.
How it connects
Connects API keys with API endpoints, secrets, network rules, external access integrations, Python UDFs, and stored procedures.

Also explained in

Compare how 13 books explain API key →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Snowflake Data Engineering. The section links point to the parts of the book it draws on.