Welcome to Genhike Sports

API reference

Source app/api/ApiController.php@44492cfc3aef Endpoint list parsed from ApiController::site() 's $endpoints array (the very list served at runtime) Rendered at 2026-11-23 20:58:48

API master switch: disabled (left off on purpose) The samples on this page were captured with the master switch temporarily enabled for one real HTTP request; the temporary token was deleted and the switch restored verbatim right after. It is off by default and no API data is served. Max per page 50 Default rate limit 120/min

Endpoints

7 endpoints, all read-only (GET and OPTIONS only; every other method gets 405). Open a path for parameters, a real response sample and error codes.

Method Path Auth Params Errors Sample Description
GET /api/v1 token 0 8 none Site information and the endpoint list
GET /api/v1/models token 0 8 none Content models and their field definitions
GET /api/v1/categories token 2 10 none Category tree, filterable by model and language
GET /api/v1/tags token 2 10 none Tag list
GET /api/v1/search token 6 11 none Cross-model keyword search
GET /api/v1/{model} token 8 11 none Content list (paging, category, tag, keyword, sorting, flags)
GET /api/v1/{model}/{id|slug} token 2 11 none Content detail (with_body=1 includes the body)

Response envelope

Success and failure share one envelope, so a client needs a single parser. The HTTP status code equals the business code (401/403/404/405/429/503).

Case HTTP JSON
Success 200 {"code":0,"message":"ok","data":{ … }}
Failure 4xx / 5xx {"code":404,"message":"Content not found","data":null}
CORS preflight 204 no body

Authentication and rate limiting

The token is read from three places in priority order: Authorization: Bearer, then X-Api-Key, then ?key= (debug fallback only, and it lands in the access log). Only the sha256 is stored; the plain token is shown once at creation.

curl -sS \
  -H 'Authorization: Bearer ry_xxxxxxxxxxxxxxxx' \
  -H 'Accept: application/json' \
  'https://www.genhikesports.com/api/v1'

Global error codes

This table is scanned out of ApiController::handle(), so a new guard in the source shows up on the next request.

Code Meaning When it happens
204 Preflight passed, no response body CORS preflight: no token required, returns 204 with no body
405
503
401
429
404
404
403
500

Paging and languages

  • The page and per_page parameters work on every list endpoint; per_page is capped by the api_page_max setting (currently 50 on this site).
  • The lang parameter defaults to the site default language; a language allow-list on the token still applies.
  • List endpoints never include the body: dozens of rich-text bodies would push a response into the megabytes. Use the detail endpoint with with_body=1 when the body is needed.

Back to the API reference home

Send an Enquiry