Query Snowflake data warehouse — execute SQL, manage warehouses, and query metadata via the SQL API.
Execute SQL queries and manage warehouses via the Snowflake SQL API.
SNOWFLAKE_ACCOUNT - Account identifier (e.g. abc12345.us-east-1)SNOWFLAKE_USER - UsernameSNOWFLAKE_PASSWORD - Passwordcurl -s -X POST \
"https://$SNOWFLAKE_ACCOUNT.snowflakecomputing.com/api/v2/statements" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $SNOWFLAKE_PASSWORD" \
-d '{"statement":"SELECT * FROM my_table LIMIT 10","warehouse":"COMPUTE_WH","database":"MY_DB","schema":"PUBLIC"}' | jq '{statementHandle, data: .data[:5]}'
curl -s -X POST \
"https://$SNOWFLAKE_ACCOUNT.snowflakecomputing.com/api/v2/statements" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $SNOWFLAKE_PASSWORD" \
-d '{"statement":"SHOW DATABASES","warehouse":"COMPUTE_WH"}' | jq '.data[]'