API_KEY="sk_your_api_key"
BASE="https://api.aws53.cloud"
# 1. Analyze a site into matching topics
curl -X POST "$BASE/v1/intent/topics/analyze" \
-H "Content-Type: application/json" \
-d '{"url":"https://snowflake.com"}'
# 2. Preview the audience
curl -X POST "$BASE/v1/intent/audiences/preview" \
-H "x-api-key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"topicIds": [117805, 117890],
"minScore": 70,
"maxScore": 99,
"minTopicOverlap": 1,
"filters": {
"company.industries": {
"values": ["software development", "information technology & services"]
},
"role.seniority": {
"values": ["director", "vp", "c_suite"]
},
"contact.hasBusinessEmail": true
}
}'
# 3. Create an audience
AUDIENCE_ID=$(curl -s -X POST "$BASE/v1/intent/audiences" \
-H "x-api-key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Marketing Directors at Tech Companies",
"status": "active",
"config": {
"topicIds": [117805, 117890],
"minScore": 70,
"maxScore": 99,
"minTopicOverlap": 1,
"filters": {
"company.industries": {
"values": ["software development", "information technology & services"]
},
"role.seniority": {
"values": ["director", "vp", "c_suite"]
},
"contact.hasBusinessEmail": true
}
}
}' | jq -r '.data.id')
# 4. Queue a materialization run
RUN_ID=$(curl -s -X POST "$BASE/v1/intent/audiences/$AUDIENCE_ID/runs" \
-H "x-api-key: $API_KEY" \
-H "Idempotency-Key: audience-run-$AUDIENCE_ID-001" \
-H "Content-Type: application/json" \
-d '{"runType":"manual"}' | jq -r '.data.id')
# 5. Poll results until the run is completed
curl "$BASE/v1/intent/audiences/$AUDIENCE_ID/runs/$RUN_ID/results?limit=50&offset=0" \
-H "x-api-key: $API_KEY"
# 6. Download CSV for a completed run
curl -L "$BASE/v1/intent/audiences/$AUDIENCE_ID/runs/$RUN_ID/export.csv" \
-H "x-api-key: $API_KEY" \
-o audience.csv