Overview
The Repurchase Engine API provides programmatic access to all simulation, scenario management, and data retrieval capabilities.Base URL:
https://api.villagelabs.com/v1All API requests require authentication via API key.Authentication
Include your API key in theAuthorization header:
Get Your API Key
Contact [email protected] to receive your API credentials.Quick Start
1
Install SDK
2
Initialize Client
3
Run Simulation
Core Endpoints
POST /simulate
Run a new simulation
GET /scenarios
List all scenarios
POST /scenarios
Create a new scenario
GET /runs/{id}
Get simulation run details
Request Format
All requests use JSON:Response Format
Standard API response structure:Error Handling
Errors return standard HTTP status codes with detailed messages:Rate Limits
Standard Tier
100 requests/hour10 simulations/hour
Enterprise Tier
Unlimited requestsDedicated infrastructure
SDKs & Libraries
- Python
- JavaScript/TypeScript
- REST API
Data Schemas
PlanRules
Legal framework schema
OperatingAssumptions
Strategy configuration schema
Response Formats
Output data structures
Webhooks
Subscribe to simulation events:Best Practices
Validate Inputs Locally
Validate Inputs Locally
Use SDK validation methods before making API calls to catch errors early
Cache Results
Cache Results
Store simulation results locally; re-run only when inputs change
Use Async Processing
Use Async Processing
For long-running simulations, use webhooks instead of polling
Handle Errors Gracefully
Handle Errors Gracefully
Implement retry logic with exponential backoff for transient errors
Next Steps
Run Simulation
Execute your first API simulation
Manage Scenarios
Create and organize scenarios
View Schemas
Complete schema reference
Examples
See full code examples
Support
Need Help?
Email: [email protected]Documentation: You’re reading it!GitHub Issues: Report bugs and request features
.png?fit=max&auto=format&n=_b1oFDtC7brS6c3Z&q=85&s=d3ec56559a51e770e67aa19d77e1da67)
.png?fit=max&auto=format&n=AWN49C5ILGJ2VJNX&q=85&s=9e43d95342e1c0ca7d9eadaa6d3acb0d)