{"openapi":"3.1.0","info":{"title":"Simutrends API","version":"1.0.0","description":"Test your idea with a simulated market. Paid per study with x402 (USDC on Base).","termsOfService":"https://simutrends.com/terms","contact":{"email":"wp@aptocode.com"}},"servers":[{"url":"https://simutrends.com"}],"paths":{"/api/simulate":{"post":{"summary":"Start a study (x402 payment required)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["idea","template","market"],"properties":{"idea":{"type":"string","minLength":20,"maxLength":4000,"description":"The product, idea or topic to study, in plain words. Include price and how it works if it is a product."},"template":{"type":"string","enum":["saas_validation","route_comparison","problem_discovery"],"description":"Study template. saas_validation: reaction to a product. route_comparison: choose between 2 or 3 routes (requires options). problem_discovery: what hurts in an industry, without showing a solution."},"options":{"type":"array","minItems":2,"maxItems":3,"items":{"type":"string","minLength":5,"maxLength":600},"description":"Only for route_comparison: the 2 or 3 routes to compare."},"market":{"description":"Where the simulated people live and work. Text such as \"MX\" or \"MX, Monterrey\" (ISO country code, then an optional city), or an object.","type":["object","string"],"examples":["MX, Monterrey",{"country":"US","region":"Texas","city":"San Antonio"}],"required":["country"],"properties":{"country":{"type":"string","pattern":"^[A-Za-z]{2}$","description":"ISO 3166-1 alpha-2 country code, e.g. MX, US, ES, BR."},"region":{"type":"string","maxLength":80,"description":"State or region (optional)."},"city":{"type":"string","maxLength":80,"description":"City (optional). If given, every persona is from this city."},"area":{"type":"string","enum":["urban","rural","mixed"],"default":"mixed"},"ses":{"type":"string","enum":["low","middle","high","mixed"],"default":"mixed","description":"Socioeconomic level."}}},"roles":{"type":["array","string"],"items":{"type":"string","enum":["business_owner","consumer","employee","supplier","investor"]},"default":["business_owner"],"examples":["business_owner","business_owner, consumer"],"description":"Who answers: business_owner, consumer, employee, supplier, investor. A list, or text separated by commas. The sample is split evenly across roles."},"industries":{"description":"Industries of the people asked: retail, restaurants, convenience_stores, services, construction, or any free text. Text separated by commas (even split), or a list of {name, weight} with weights adding up to 100.","type":["array","string"],"examples":["restaurants, convenience_stores",[{"name":"restaurants","weight":70},{"name":"retail","weight":30}]],"minItems":1,"maxItems":8,"items":{"type":"object","required":["name"],"properties":{"name":{"type":"string","description":"retail, restaurants, convenience_stores, services, construction, or any free-text industry."},"weight":{"type":"number","description":"Share of the sample in percent. Weights must add up to 100; omit all weights for an even split."}}}},"sample_size":{"type":"integer","minimum":10,"maximum":1000,"default":100,"description":"Number of AI personas, 10 to 1000. The price is personas × rate."},"model":{"type":"string","enum":["fast","heavy"],"default":"fast","description":"fast: low cost. heavy: deeper answers, higher price."},"study_type":{"type":"string","enum":["problem_discovery","idea_reaction","option_comparison"],"description":"Defaults to the template’s study type."},"language":{"type":"string","default":"es","description":"Language of answers and report, e.g. es, es-MX, en, pt-BR."}}},"example":{"idea":"Online ordering page for small restaurants: customers order from a link on WhatsApp or Instagram, the restaurant gets the order on a tablet. US$29 per month, no commission per order.","template":"saas_validation","market":{"country":"MX","city":"Monterrey"},"industries":[{"name":"restaurants","weight":70},{"name":"convenience_stores","weight":30}],"sample_size":100,"model":"fast","language":"es"}}}},"responses":{"202":{"description":"Payment settled, study queued. Returns job_id."},"400":{"description":"Invalid request or content rejected. No payment taken."},"402":{"description":"Payment required. The PAYMENT-REQUIRED header and the body carry the x402 payment requirements with the exact price for this request."},"503":{"description":"Service paused or provider unavailable. No payment taken."}}}},"/api/simulate/{job_id}":{"get":{"summary":"Study status, progress and final report (free)","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Status and, when finished, the report."},"404":{"description":"Unknown job_id."}}}},"/api/estimate":{"get":{"summary":"Price estimate (free)","parameters":[{"name":"sample_size","in":"query","schema":{"type":"integer"}},{"name":"model","in":"query","schema":{"type":"string","enum":["fast","heavy"]}}],"responses":{"200":{"description":"Price and estimated time."}}},"post":{"summary":"Price estimate for a full request, with library reuse (free). An empty body returns the default estimate.","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","required":["idea","template","market"],"properties":{"idea":{"type":"string","minLength":20,"maxLength":4000,"description":"The product, idea or topic to study, in plain words. Include price and how it works if it is a product."},"template":{"type":"string","enum":["saas_validation","route_comparison","problem_discovery"],"description":"Study template. saas_validation: reaction to a product. route_comparison: choose between 2 or 3 routes (requires options). problem_discovery: what hurts in an industry, without showing a solution."},"options":{"type":"array","minItems":2,"maxItems":3,"items":{"type":"string","minLength":5,"maxLength":600},"description":"Only for route_comparison: the 2 or 3 routes to compare."},"market":{"description":"Where the simulated people live and work. Text such as \"MX\" or \"MX, Monterrey\" (ISO country code, then an optional city), or an object.","type":["object","string"],"examples":["MX, Monterrey",{"country":"US","region":"Texas","city":"San Antonio"}],"required":["country"],"properties":{"country":{"type":"string","pattern":"^[A-Za-z]{2}$","description":"ISO 3166-1 alpha-2 country code, e.g. MX, US, ES, BR."},"region":{"type":"string","maxLength":80,"description":"State or region (optional)."},"city":{"type":"string","maxLength":80,"description":"City (optional). If given, every persona is from this city."},"area":{"type":"string","enum":["urban","rural","mixed"],"default":"mixed"},"ses":{"type":"string","enum":["low","middle","high","mixed"],"default":"mixed","description":"Socioeconomic level."}}},"roles":{"type":["array","string"],"items":{"type":"string","enum":["business_owner","consumer","employee","supplier","investor"]},"default":["business_owner"],"examples":["business_owner","business_owner, consumer"],"description":"Who answers: business_owner, consumer, employee, supplier, investor. A list, or text separated by commas. The sample is split evenly across roles."},"industries":{"description":"Industries of the people asked: retail, restaurants, convenience_stores, services, construction, or any free text. Text separated by commas (even split), or a list of {name, weight} with weights adding up to 100.","type":["array","string"],"examples":["restaurants, convenience_stores",[{"name":"restaurants","weight":70},{"name":"retail","weight":30}]],"minItems":1,"maxItems":8,"items":{"type":"object","required":["name"],"properties":{"name":{"type":"string","description":"retail, restaurants, convenience_stores, services, construction, or any free-text industry."},"weight":{"type":"number","description":"Share of the sample in percent. Weights must add up to 100; omit all weights for an even split."}}}},"sample_size":{"type":"integer","minimum":10,"maximum":1000,"default":100,"description":"Number of AI personas, 10 to 1000. The price is personas × rate."},"model":{"type":"string","enum":["fast","heavy"],"default":"fast","description":"fast: low cost. heavy: deeper answers, higher price."},"study_type":{"type":"string","enum":["problem_discovery","idea_reaction","option_comparison"],"description":"Defaults to the template’s study type."},"language":{"type":"string","default":"es","description":"Language of answers and report, e.g. es, es-MX, en, pt-BR."}}},"example":{"idea":"Online ordering page for small restaurants: customers order from a link on WhatsApp or Instagram, the restaurant gets the order on a tablet. US$29 per month, no commission per order.","template":"saas_validation","market":{"country":"MX","city":"Monterrey"},"industries":[{"name":"restaurants","weight":70},{"name":"convenience_stores","weight":30}],"sample_size":100,"model":"fast","language":"es"}}}},"responses":{"200":{"description":"Price, time and sample plan."}}}},"/api/templates":{"get":{"summary":"Available study templates (free)","responses":{"200":{"description":"Templates."}}}},"/v1/models":{"get":{"summary":"Panel questions: AI models by class and price per person (free)","responses":{"200":{"description":"Menu of models and prices."}}}},"/v1/markets":{"get":{"summary":"Panel questions: market files, their topics and source sites (free)","responses":{"200":{"description":"Catalog of market files."}}}},"/v1/quote":{"post":{"summary":"Panel questions: exact price of a question (free)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["question"],"properties":{"question":{"type":"string","minLength":20,"maxLength":2000},"options":{"type":"array","items":{"type":"string","maxLength":200},"minItems":2,"maxItems":20},"select":{"type":"string","enum":["one","many"]},"max_choices":{"type":"integer","minimum":1},"market":{"description":"Country (ISO code) or an object with country, region, city, area, ses. Required unless panel_id is given."},"roles":{"description":"Who answers: business_owner, consumer, employee, supplier, investor."},"industries":{"description":"Industries of the people, as a list or plain text."},"people":{"type":"integer","minimum":10,"maximum":300},"models":{"description":"A class (economy, standard, premium), a model name, or a mix with shares such as {\"economy\": 70, \"premium\": 30}."},"market_file":{"type":"string","description":"Id of a market file. See GET /v1/markets."},"market_topics":{"type":"array","items":{"type":"string"}},"own_facts":{"type":"array","maxItems":10,"items":{"type":"object","required":["text"],"properties":{"text":{"type":"string","minLength":20,"maxLength":500},"share":{"type":"number","minimum":1,"maximum":100}}}},"starting_point":{"type":"string","enum":["drawn"]},"panel_id":{"type":"string"},"panel_token":{"type":"string"},"language":{"type":"string"}}},"example":{"question":"We offer your business its own ordering page: customers order ahead from their phone and pick up. No commission per order, free plan. What would you do?","options":["I would try it this month","Later, not now","Only if someone sets it up for me","Not interested"],"market":"PR","industries":"restaurants","people":100,"models":{"economy":70,"standard":30},"market_file":"PR-restaurants","language":"en"}}}},"responses":{"200":{"description":"Price, split by model and how much of the panel can be filled."},"400":{"description":"Invalid request."}}}},"/v1/ask":{"post":{"summary":"Ask a simulated panel any question (x402 payment required)","description":"Full guide: https://simutrends.com/panel.md","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["question"],"properties":{"question":{"type":"string","minLength":20,"maxLength":2000},"options":{"type":"array","items":{"type":"string","maxLength":200},"minItems":2,"maxItems":20},"select":{"type":"string","enum":["one","many"]},"max_choices":{"type":"integer","minimum":1},"market":{"description":"Country (ISO code) or an object with country, region, city, area, ses. Required unless panel_id is given."},"roles":{"description":"Who answers: business_owner, consumer, employee, supplier, investor."},"industries":{"description":"Industries of the people, as a list or plain text."},"people":{"type":"integer","minimum":10,"maximum":300},"models":{"description":"A class (economy, standard, premium), a model name, or a mix with shares such as {\"economy\": 70, \"premium\": 30}."},"market_file":{"type":"string","description":"Id of a market file. See GET /v1/markets."},"market_topics":{"type":"array","items":{"type":"string"}},"own_facts":{"type":"array","maxItems":10,"items":{"type":"object","required":["text"],"properties":{"text":{"type":"string","minLength":20,"maxLength":500},"share":{"type":"number","minimum":1,"maximum":100}}}},"starting_point":{"type":"string","enum":["drawn"]},"panel_id":{"type":"string"},"panel_token":{"type":"string"},"language":{"type":"string"}}},"example":{"question":"We offer your business its own ordering page: customers order ahead from their phone and pick up. No commission per order, free plan. What would you do?","options":["I would try it this month","Later, not now","Only if someone sets it up for me","Not interested"],"market":"PR","industries":"restaurants","people":100,"models":{"economy":70,"standard":30},"market_file":"PR-restaurants","language":"en"}}}},"responses":{"202":{"description":"Payment settled, question queued. Returns job_id, panel_id and panel_token."},"400":{"description":"Invalid request, or a question that asks the panel to reveal its profile. No payment taken."},"402":{"description":"Payment required. The PAYMENT-REQUIRED header and the body carry the exact price for this request."},"503":{"description":"Service paused or provider unavailable. No payment taken."}}}},"/v1/ask/{job_id}":{"get":{"summary":"Panel question: status and answers (free)","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Status and, when finished, every answer with basic traits."},"404":{"description":"No job with that id."}}}}}}