Base URL
All API requests should be made to:Available endpoints
The API provides the following endpoints:Probability calculation
- POST /api/alg - Calculate the probability of being able to play a specific card given a deck composition and number of draws
Card search
- GET /api/cards/allcards - Retrieve all card names and IDs
- GET /api/cards/filteredcards/:value - Search for cards by name (returns first 10 matches)
Request format
All POST requests should include aContent-Type: application/json header and a JSON request body.
Response format
All responses are returned in JSON format. Successful requests return a200 status code.
Authentication
The API does not require authentication. All endpoints are publicly accessible.Error handling
Errors are returned with appropriate HTTP status codes:- 400 Bad Request - Invalid request parameters
- 404 Not Found - Endpoint not found
- 500 Internal Server Error - Server error during processing
Rate limiting
There are currently no rate limits on API requests.Card object structure
Many endpoints work with card objects. A typical card object includes:ProducibleManaColors field contains comma-separated color codes (e.g., "R,G" for a land that produces red or green mana).
Next steps
Probability endpoint
Calculate draw probabilities
Algorithm explanation
Understand the math
