Interactive API Testing
The Hoops Finance API documentation includes interactive testing capabilities that allow you to test API endpoints directly from the documentation without leaving your browser.
How to Use Interactive Testing
1. Navigate to API Reference
Visit the API Reference section to access the interactive documentation.
2. Find an Endpoint
Browse through the available endpoints or use the search functionality to find the endpoint you want to test.
3. Try It Out
Look for the "Try it out" button next to each endpoint. Click it to enable interactive testing mode.
4. Configure Parameters
- Path Parameters: Fill in required path parameters (like token addresses or pair IDs)
- Query Parameters: Add optional query parameters (like pagination, filters, etc.)
- Headers: The documentation will automatically include necessary headers
5. Execute the Request
Click the "Execute" button to send a real request to the Hoops Finance API.
6. View the Response
The response will be displayed with:
- HTTP Status Code: 200, 404, 500, etc.
- Response Headers: Including rate limiting information
- Response Body: The actual JSON data returned by the API
Example: Testing the Protocols Endpoint
- Go to the API Reference and find the GET /protocols endpoint
- Click "Try it out"
- Click "Execute" (no parameters needed for this endpoint)
- View the live response showing all supported DeFi protocols
Example: Testing a Specific Pair
- Find the GET /pairs/{pairContract} endpoint
- Click "Try it out"
- Enter a pair contract address like:
CAB6MICC2WKRT372U3FRPKGGVB5R3FDJSMWSLPF2UJNJPYMBZ76RQVYE
- Click "Execute"
- View detailed information about that specific liquidity pair
Rate Limiting
When testing interactively, you're subject to the same rate limits as regular API usage:
- 120 requests per minute
- 30 requests burst limit
Rate limit headers will be shown in the response, including:
X-RateLimit-Limit
: Your rate limitX-RateLimit-Remaining
: Remaining requestsX-RateLimit-Reset
: When the limit resets
CORS Support
The Hoops Finance API supports CORS (Cross-Origin Resource Sharing), which enables the interactive testing to work directly from your browser.
Tips for Testing
Use Real Data
- The interactive testing uses the live production API
- All responses contain real, up-to-date data
- Be mindful of rate limits when testing extensively
Test Different Scenarios
- Try valid parameters to see successful responses
- Try invalid parameters to see error responses
- Test edge cases like non-existent token addresses
Copy Examples
- Use the "Copy" button to copy successful requests
- Adapt the examples for your own applications
- Note the exact parameter formats and required fields
Common Endpoints to Test
Basic Information
GET /protocols
- List all supported protocolsGET /tokens
- List all tracked tokensGET /pairs
- List all liquidity pairs
Specific Data
GET /pairs/\{pairContract\}
- Get specific pair detailsGET /tokens/\{tokenAddress\}
- Get specific token informationGET /tokens/\{tokenAddress\}/pairs
- Get pairs for a token
Analytics
GET /getmetrics
- Platform-wide metricsGET /getstatistics
- Per-pair statistics
AI Endpoints
GET /ai/tokens
- AI-formatted token dataGET /ai/pairs
- AI-formatted pair dataGET /ai/whales
- Top liquidity providers
Troubleshooting
Request Failed
- Check that all required parameters are provided
- Verify parameter formats (especially contract addresses)
- Ensure you haven't exceeded rate limits
CORS Errors
- The API should support CORS, but some browser extensions may interfere
- Try disabling ad blockers or privacy extensions temporarily
- Use an incognito/private browsing window
Invalid Responses
- Verify the parameter values are correct
- Check the API status at the base URL:
https://api.hoops.finance
- Some endpoints may require specific parameter combinations
Happy testing! 🚀