Перейти к содержимому

Public API

Это содержимое пока не доступно на вашем языке.

The TrucklineMP Public API is a read-only REST surface for third-party integrations. It exposes VTC directory data, events, news, user search, moderation records, and platform metadata.

All endpoints are available without authentication. Passing a Developer Console API key increases your rate limits and links requests to your project.

Send your API key in the Authorization header:

Authorization: Bearer tl_YOUR_API_KEY

API keys:

  • Use the tl_ prefix (for example tl_a1b2c3...).
  • Are created per project in the Developer Console.
  • Are shown once at creation. Store them securely.
  • Provide read-only access to public data. They do not unlock private account actions or write operations.
  • Can be revoked at any time from the console.

Invalid or revoked keys are ignored. The request is treated as anonymous and receives anonymous rate limits.

Some endpoints return extra fields when you are logged in on trucklinemp.com and send session cookies with the request (for example, member-only VTC fields). This is optional and intended for first-party use. Third-party integrations should rely on API keys and OAuth where applicable.

Choose the base URL that matches your environment:

EnvironmentBase URLNotes
Productionhttps://api.trucklinemp.comRecommended for live integrations
Developmenthttps://api-dev.trucklinemp.comStaging / beta data
Localhttp://localhost:3000/api/v1Local Web app dev server
Same-originhttps://trucklinemp.com/api/v1Used by the in-browser playground

Production and development hostnames (api.trucklinemp.com, api-dev.trucklinemp.com) route through nginx. A request to:

https://api.trucklinemp.com/vtcs

is proxied to /api/v1/vtcs on the app. Do not append /v1 to the hostname URL.

Local development and same-origin requests use /api/v1 directly:

http://localhost:3000/api/v1/vtcs
https://trucklinemp.com/api/v1/vtcs
Terminal window
curl "https://api.trucklinemp.com/version"
curl -H "Authorization: Bearer tl_YOUR_API_KEY" \
"https://api.trucklinemp.com/vtcs?limit=10"

Limits apply per client IP for anonymous traffic and per API key (and IP) when a valid key is present. Limits are enforced over a 1-minute window and a 5-minute window. Exceeding either returns HTTP 429 with a RATE_LIMITED error.

WindowLimit
1 minute100 requests
5 minutes400 requests
Tier1 minute5 minutes
free (default)1,0005,000
basic2,50012,000
premium5,00025,000
unlimited20,00080,000

Tier assignment is managed by TrucklineMP staff. Contact support if your integration needs a higher tier.

  • Cache responses where possible. Many list endpoints support pagination.
  • Back off on 429 responses. Reduce concurrency before retrying.
  • Always send a valid API key in production. Anonymous limits are intended for light testing only.

The OpenAPI spec at trucklinemp.com/api/v1/openapi.json is the source of truth. Major resource groups:

GroupExamples
PlatformGET /version, GET /status, GET /rules, GET /partners, GET /stats
VTCsGET /vtcs, GET /vtcs/{idOrHandle}, GET /vtcs/{id}/members, GET /vtcs/{id}/news, GET /vtcs/{id}/events, GET /vtcs/{id}/roles
EventsGET /events, GET /events/{eventId}, GET /events/{eventId}/attendees, GET /events/{eventId}/slots
NewsGET /news, GET /news/{newsId}
UsersGET /users/search, GET /users/{handleOrId}, GET /users/{id}/bans, GET /users/{id}/events
BansGET /bans, GET /bans/{id}
ProgramsGET /programs/badges/{slug}, GET /programs/recognition
SessionGET /session (cookie-based session introspection)

Path parameters such as {idOrHandle} accept either a numeric ID or a public handle where noted in the spec.

Common error codes:

CodeHTTPMeaning
UNAUTHORIZED401Missing or invalid credentials on a protected route
FORBIDDEN403Valid auth but insufficient permission
NOT_FOUND404Resource does not exist
RATE_LIMITED429Rate limit exceeded
VALIDATION_ERROR400Invalid query or path parameters