Overview
The Primox REST API v1 provides programmatic access to your shooting data. With over 50 endpoints, you can manage rifles, projects, sessions, loads, and recipes. You can run analysis computations, access reference data, and even run internal ballistics simulations.
The API uses standard REST conventions: JSON request and response bodies, Bearer token authentication, and conventional HTTP status codes. Every endpoint that exists in the web interface has an API equivalent.
Base URL and Authentication
All API requests go to the v1 base URL and require a Bearer token in the Authorization header. Create an API key in Settings if you have not already.
Base URL
https://www.primox.net/api/v1/Authentication Header
Authorization: Bearer pmx_live_your_key_hereExample Request (cURL)
curl -H "Authorization: Bearer pmx_live_your_key_here" \
https://www.primox.net/api/v1/riflesCore Endpoints
The API is organized into four categories. Each endpoint supports standard CRUD operations where applicable.
Resources
Your shooting data: rifles, projects, sessions, loads, recipes, and components (barrels, powders, projectiles, primers, brass).
/rifles, /projects, /sessions, /loads, /recipes, /barrels, /powders, /projectiles, /primers, /brass
Analysis
Pure computation endpoints that analyze your data. Velocity statistics, group analysis, ladder node detection, seating depth trends, and cross-session comparison.
/analyze/velocities, /analyze/group, /analyze/ladder, /analyze/seating-depth, /analyze/compare
Reference Data
Global reference data shared across all users. Calibers, manufacturers, propellant physics, cartridge specifications, and published load data.
/reference/calibers, /reference/manufacturers, /reference/propellants, /reference/cartridges, /reference/published-loads
Simulation
Internal ballistics engine simulation. Submit cartridge, propellant, and projectile data to get predicted pressure and velocity curves.
/simulate (POST, analyze scope, 20 req/min)
Pagination
List endpoints that accept limit and offset return results one page at a time. Use limit to set the page size, and offset to skip the records you already have. A limit above 100 is reduced to 100 without an error. There is no total-count header: a response with fewer records than the page size (your limit, or 100 if you asked for more) means you have reached the end.
Pagination Parameters
GET /api/v1/rifles?limit=25&offset=25The default limit is 50 and the maximum is 100. To read the next page, add the page size to offset: with the default limit, offset=0, then 50, then 100, and so on.
Error Handling
The API uses standard HTTP status codes. Successful requests return 200. Errors return an appropriate status code with a JSON body describing the problem.
| Code | Meaning |
|---|---|
| 200 | Request succeeded. Response body contains the requested data. |
| 400 | Invalid request. Check your request body, query parameters, or URL. |
| 401 | Missing or invalid API key. Check your Authorization header. |
| 403 | Your API key does not have the required scope for this endpoint. |
| 404 | The requested resource does not exist or does not belong to your account. |
| 429 | Too many requests. Wait and retry after the rate limit window resets. |
| 500 | Unexpected server error. Retry the request or contact support if it persists. |
Error Response Format
{
"error": "Charge weight is required",
"code": "VALIDATION_ERROR"
}Rate Limits
API requests are rate-limited per key on a per-minute sliding window. Read endpoints have higher limits than write and simulation endpoints. When you hit a rate limit, the API returns a 429 status code with a Retry-After header.
The simulation endpoint has a stricter limit of 20 requests per minute due to its computational cost. Plan batch simulations accordingly.
Example Workflow
A typical API workflow mirrors what you would do in the web interface: create a project, start a session, log your shots, then retrieve the analysis report.
Create a project
curl -X POST \
-H "Authorization: Bearer pmx_live_..." \
-H "Content-Type: application/json" \
-d '{"name": "6.5 CM Load Dev", "rifle_id": "..."}' \
https://www.primox.net/api/v1/projectsCreate a session
curl -X POST \
-H "Authorization: Bearer pmx_live_..." \
-H "Content-Type: application/json" \
-d '{"project_id": "...", "session_type": "ladder", "distance_yards": 100}' \
https://www.primox.net/api/v1/sessionsLog shots with velocities
curl -X POST \
-H "Authorization: Bearer pmx_live_..." \
-H "Content-Type: application/json" \
-d '{"shots": [{"load_id": "...", "velocity_fps": 2745}, {"load_id": "...", "velocity_fps": 2751}]}' \
https://www.primox.net/api/v1/sessions/{id}/shotsGet the analysis report
curl -H "Authorization: Bearer pmx_live_..." \
https://www.primox.net/api/v1/sessions/{id}/reportNext Steps
Now that you understand the API, explore the MCP server for Claude integration or the CLI for terminal workflows.
