Dropshipping Profit Calculator API
Integrate our powerful profit calculation engine directly into your applications.
API Overview
Our RESTful API allows you to programmatically access the same profit calculation engine that powers our web calculator. Integrate dropshipping profit calculations directly into your ecommerce dashboard, mobile app, or business tools.
POST https://api.to2.icu/v1/calculate
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY
{
"product_price": 15.99,
"selling_price": 39.99,
"shipping_cost": 4.99,
"platform_fee_percent": 2.9,
"payment_fee_percent": 2.9,
"advertising_cost": 5.0,
"other_costs": 2.0
}
{
"success": true,
"data": {
"gross_profit": 24.00,
"total_fees": 7.82,
"net_profit": 16.18,
"profit_margin": 40.45,
"roas": 4.80
}
}
Authentication
All API requests require authentication using your API key. Include it in the Authorization header of your requests:
Authorization: Bearer YOUR_API_KEY
Keep your API key secure and never expose it in client-side code. If your key is compromised, you can regenerate it in your account dashboard.
Rate Limits
API requests are subject to rate limits based on your subscription plan:
- Free Tier: 100 requests/month
- Basic Plan: 1,000 requests/month
- Pro Plan: 10,000 requests/month
- Enterprise: Custom limits
You can check your current usage in the response headers:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 872
X-RateLimit-Reset: 1640995200
API Endpoints
Calculate Profit
Perform a profit calculation with the provided parameters.
Get Calculation History
Retrieve your saved calculations (available on paid plans).
Get Calculation by ID
Retrieve a specific saved calculation.
Get API Usage
Check your current API usage and limits.
Response Codes
- 200 Success
- 201 Created (for saved calculations)
- 400 Bad Request
- 401 Unauthorized
- 429 Too Many Requests
- 500 Server Error
Client Libraries
JavaScript
Official library for Node.js and browser environments.
Python
Compatible with Python 3.6+ for seamless integration.
PHP
Composer package for PHP applications.
FAQ
How do I get an API key?
Sign up for an account on our pricing page and you'll find your API key in the account dashboard. Free tier keys have limited functionality.
What's the difference between the free and paid API?
The free tier has rate limits and doesn't include features like calculation history or webhooks. Paid plans offer higher limits, advanced features, and priority support.
Can I use the API for commercial applications?
Yes, with the appropriate subscription plan. Our Pro and Enterprise plans include commercial usage rights. Please review our pricing and terms for details.
Is there a sandbox environment for testing?
Yes, you can use our sandbox endpoint at https://sandbox.api.to2.icu/v1/ with test API keys that don't count against your limits.
How often is the API updated?
We maintain backward compatibility with all API versions. New features are added to the latest version while maintaining older versions for at least 12 months after a new release.