Improvement suggestions: We welcome your feedback and suggestions for improving our APIs. Please reach out to us at [email protected] with any suggestions or questions.
Overview
The TakeProfit APIs provide partners with financial data and integration tools. Our APIs include:Security Linking
Manage the linkage between your own securities and those provided by
TakeProfit.
Reference Data
Retrieve detailed information on financial instruments, exchanges, and other
entities.
Market Data
Access real-time and historical market data across various asset classes.
High-Level Workflow
Workflow Example
Credentials API
The Credentials API is your entry point. It allows you to authenticate and receive tokens for accessing other APIs securely.Usage Flow
- Create Token: Send your
api_keyto receive tokens. - Refresh Token: Use the
refresh_tokento obtain a newaccess_tokenwhen needed.
Note: The lifetime of the access_token is 30 minutes.
Example: Logging In
Note: Keep your tokens secure and never expose them publicly.
Best Practices
Secure Storage
- Protect Credentials: Store your
api_key,access_token, andrefresh_tokensecurely. - Avoid Exposure: Do not expose tokens in client-side code or public repositories.
Token Management
- Monitor Expiration: Keep track of token
valid_to_timeto refresh tokens proactively. Token lifetime is 30 minutes. - Handle Failures: Implement retry logic for token refresh failures.
Error Handling
- Check Status Codes: Always check the
status.codein responses. - Log Errors: Log error messages for troubleshooting, but avoid logging sensitive information.
Rate Limiting
- Be Mindful: Respect any rate limits to avoid service interruptions.
- Implement Backoff: Use exponential backoff strategies when retrying requests.
FAQs
How do I obtain an api_key?
Contact our sales team at [email protected] to obtain your unique api_key.
What should I do if my access_token expires?
Use the refresh_token with the Auth API’s Refresh method to obtain a new access_token.
Example: Refreshing Token