API Documentation
Integrate Open Sparrow's powerful features into your applications
Getting Started
The Open Sparrow API allows you to programmatically manage your products, subscriptions, and analytics. All API requests must be authenticated using your API key.
Base URL
https://opensparrow.com/api/v1
Authentication
Include your API key in the Authorization header:
Authorization: Bearer YOUR_API_KEY
Products API
List Products
/api/v1/products
Retrieve all your products with pagination support.
Query Parameters:
page
- Page number (default: 1)per_page
- Items per page (default: 20, max: 100)status
- Filter by status (active, inactive)
Create Product
/api/v1/products
Create a new product with file upload support.
Request Body:
{
"title": "Product Name",
"description": "Product description",
"price": 29.99,
"category": "digital",
"files": ["file1_id", "file2_id"]
}
Subscriptions API
List Subscription Tiers
/api/v1/tiers
Get all your subscription tiers and their details.
Create Subscription Tier
/api/v1/tiers
Request Body:
{
"name": "Premium Tier",
"description": "Access to premium content",
"price": 19.99,
"billing_interval": "monthly",
"features": ["feature1", "feature2"]
}
List Subscribers
/api/v1/subscribers
Retrieve subscribers with filtering options.
Analytics API
Revenue Analytics
/api/v1/analytics/revenue
Get revenue data with date range filtering.
Query Parameters:
start_date
- Start date (YYYY-MM-DD)end_date
- End date (YYYY-MM-DD)granularity
- Data granularity (day, week, month)
Subscriber Growth
/api/v1/analytics/subscribers
Track subscriber growth over time.
Webhooks
Open Sparrow sends webhook notifications for important events. Configure your webhook URLs in your account settings.
Supported Events
product.created
- New product createdproduct.sold
- Product purchasedsubscription.created
- New subscriptionsubscription.cancelled
- Subscription cancelledpayment.completed
- Payment processed successfully
Webhook Payload Example
{
"event": "product.sold",
"timestamp": "2025-01-15T10:30:00Z",
"data": {
"product_id": "prod_123",
"buyer_email": "customer@example.com",
"amount": 29.99,
"currency": "USD"
}
}
Rate Limits
Free Plan
API access not available
Business Pro
1,000 requests/hour
Enterprise
10,000 requests/hour
Rate limits are per API key. Contact support for higher limits.