Quick start
Get from zero to a 200 OK in two steps.
You’ll need a Spate account and a terminal.
-
Generate an API key
Go to app.spate.nyc/settings/api, generate your key and copy it somewhere safe.
Keys are shown only once.
See Authentication for the full flow.
-
Make your first call
In your terminal, export the key and hit the Top 5 Trends endpoint:
Terminal window export SPATE_API_KEY="__paste_your_secret_key_here__"# Top 5 US Beauty trendscurl "https://api.spate.nyc/v1/latest/cat1/trends/top5/popindex/us/6d408533-6979-43aa-80af-4d88bf0be860" \-H "Authorization: Bearer $SPATE_API_KEY"A
200 OKmeans everything is working.For other responses, see the endpoint reference.
-
Validate the data
Using jq and column, you can extract and format part of the response.
To view the data as a table, and compare it to the dashboard:
Terminal window export SPATE_API_KEY="__paste_your_secret_key_here__"response=$(curl "https://api.spate.nyc/v1/latest/cat1/trends/top5/popindex/us/6d408533-6979-43aa-80af-4d88bf0be860" \-H "Authorization: Bearer $SPATE_API_KEY")echo "# Dashbord URL: $(echo $response | jq -r '.data.dashboard')"echo "# Data:"echo "$response" | jq -r '["Rank", "Trend", "Popularity", "YoY", "YoY prediction"],(.data.trends[] | [.rank, .cat5_label, .popularity, .yoy_percent_increase, .yoy_percent_increase_prediction])| @tsv' | column -t -s $'\t'
Next steps
Section titled “Next steps” Top Trends Full parameter, response, and error docs for the top trends endpoint.
Pricing Credit costs per endpoint and how the weekly refresh window works.