ON THIS PAGE
QuickstartAuthenticationEndpointsCode ExamplesDemographic PresetsUse CasesRate Limits & TiersQuickstart
Three steps to field your first study:
1. Get an API key
Programmatic access requires a CrowdAI account on the Pro or Enterprise plan. Create a key by posting your user ID:
curl -X POST https://crowdai.up.railway.app/api/v1/developer/keys \
-H "Content-Type: application/json" \
-d '{"user_id": "YOUR_USER_ID", "name": "My App"}'Save the key field from the response — the raw value is shown only once at creation.
2. Run a simulation
One API call creates, runs, and returns the full results payload:
curl -X POST https://crowdai.up.railway.app/api/v1/developer/simulations \
-H "Authorization: Bearer crowd_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"topic": "Should companies mandate return-to-office?",
"mode": "voting",
"demographic_preset": "us_general_population",
"population_size": 50
}'3. Read the results
The response includes a resultsobject with the sentiment summary, diversity score, and every respondent’s individual response — persona, demographics, OCEAN profile, and cited reasoning.
Authentication
All endpoints (except key creation) require a Bearer token in the Authorization header:
Authorization: Bearer crowd_aBcDeFgH1234...Keys are prefixed with crowd_ and stored as SHA-256 hashes on our infrastructure. The raw key is returned only at creation.
Security notice: Treat API keys as credentials. Do not commit to version control or expose in client-side code. Resolve via environment variables.
Endpoints
KEY MANAGEMENT
/developer/keysCreate a new API key (requires user_id + pro/enterprise plan)
/developer/keysList all your API keys
/developer/keys/{id}Revoke an API key
/developer/usageMonthly usage summary (simulations, tokens, cost)
SIMULATIONS
/developer/simulationsField a study synchronously and receive the full results payload
/developer/simulations/asyncLaunch a study in the background (returns immediately with polling URLs)
/developer/simulations/{id}Retrieve a study and its findings
/developer/simulations/{id}/statusLightweight status poll (no payload)
/developer/presetsEnumerate all demographic presets with OCEAN profiles
Code Examples
PYTHON
import requests
API_KEY = "crowd_YOUR_API_KEY"
BASE = "https://crowdai.up.railway.app/api/v1/developer"
headers = {"Authorization": f"Bearer {API_KEY}"}
# Run a simulation
response = requests.post(f"{BASE}/simulations", headers=headers, json={
"topic": "Is remote work better for productivity?",
"mode": "voting",
"demographic_preset": "tech_early_adopters",
"population_size": 100,
"stance_statement": "Remote work improves employee productivity",
})
result = response.json()
print(f"Status: {result['status']}")
print(f"Results: {result['results']['summary']}")
# List available presets
presets = requests.get(f"{BASE}/presets", headers=headers).json()
print(f"{presets['count']} presets available")ASYNC (LARGE POPULATIONS)
# Launch in background (returns immediately)
curl -X POST https://crowdai.up.railway.app/api/v1/developer/simulations/async \
-H "Authorization: Bearer crowd_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"topic": "Should companies mandate return-to-office?",
"mode": "voting",
"demographic_preset": "us_general_population",
"population_size": 500
}'
# Response: { "id": "sim-abc", "status": "pending",
# "poll_url": "/api/v1/developer/simulations/sim-abc/status",
# "results_url": "/api/v1/developer/simulations/sim-abc" }
# Poll until complete
curl -H "Authorization: Bearer crowd_YOUR_API_KEY" \
https://crowdai.up.railway.app/api/v1/developer/simulations/SIM_ID/status
# Fetch full results once status is "complete"
curl -H "Authorization: Bearer crowd_YOUR_API_KEY" \
https://crowdai.up.railway.app/api/v1/developer/simulations/SIM_IDJAVASCRIPT / TYPESCRIPT
const API_KEY = "crowd_YOUR_API_KEY";
const BASE = "https://crowdai.up.railway.app/api/v1/developer";
// Run a simulation
const response = await fetch(`${BASE}/simulations`, {
method: "POST",
headers: {
"Authorization": `Bearer ${API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
topic: "What do consumers think about subscription fatigue?",
mode: "voting",
demographic_preset: "millennials",
population_size: 200,
}),
});
const { id, status, results } = await response.json();
console.log(`Simulation ${id}: ${status}`);
console.log("Summary:", results.summary);
// Each agent's response includes their persona + reasoning
for (const agent of results.agents.slice(0, 3)) {
console.log(`${agent.name} (${agent.sentiment}): ${agent.reasoning}`);
}Demographic Presets
Every study targets a demographic preset — a statistically grounded population model calibrated against published distributions (US ACS 2023, UK ONS 2021, AU ABS 2021) with OCEAN trait distributions from Rentfrow 2008 and Schmitt 2007.
Forty-two presets ship by default across six categories. Enumerate via GET /developer/presets or reference this selection:
us_general_population
US General Pop
Census-weighted American adults
millennials
Millennials (28-43)
Digital-savvy, experience-focused
tech_early_adopters
Tech Adopters
Innovation-driven professionals
india_urban
India (Urban)
Delhi, Mumbai, Bangalore metros
germany
Germany
Manufacturing + engineering economy
au_melbourne
Melbourne, AU
Arts, coffee, university culture
japan
Japan
Aging population, consensus culture
brazil
Brazil
Services + commodities, coastal + interior
+ 34 more including US states, UK regions, Australian metros, South Korea, France, Canada, Mexico, and age cohorts.
Application Domains
The API supplements traditional survey and qualitative panel research. Representative deployments:
Message-market fit
Field value-proposition research across multiple audience presets before go-to-market commitment. Re-field the identical instrument by preset to quantify resonance differentials.
Market entry research
Prior to geographic expansion, quantify local sentiment toward the product category. Country-specific presets carry localized demographics and culturally calibrated trait distributions.
Message variant testing
Evaluate multiple copy variants against an identical respondent panel via the stance_statement parameter. Sentiment and cited reasoning attribute outperformance to specific factors.
Policy impact assessment
Quantify public reaction to proposed policy across demographic segments. Re-field by preset to isolate regional, generational, and cohort-level response differentials.
Content strategy validation
Pre-field press releases, long-form content, and social campaigns against a representative respondent panel. Structured agree/disagree/undecided output with per-respondent reasoning.
Competitive positioning research
Measure brand perception relative to competitors. Stance statements fix the comparison axis for clean sentiment measurement across customer segments.
Rate Limits & Tiers
Fielding duration:A 20-respondent Pulse study typically completes in 5–15 seconds. Panels at scale (200+ respondents) typically field in 30–120 seconds. For large populations, use POST /simulations/async which returns immediately, then poll GET /simulations/{id}/status until complete. Rate-limited requests receive a 429 with a Retry-After header.
Ready to ask the crowd?
Sign up for a Pro plan, create an API key, and run your first simulation in under a minute.
Get started