# Search trains (v1)

Find Indian Railways trains by name or number, with each train's first and last station. A query nothing matches returns empty `results`.

- Platform: Indian Rail
- Request: `GET https://api.toolzerhub.com/v1/indianrail/trains/search`
- Auth: `x-api-key` header
- Cost: 1 credit per successful request. Failed requests are not billed.
- Page: https://docs.toolzerhub.com/reference/indian-rail/search/get-indian-rail-train-search

| Parameter | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `query` | query | yes | string | A train name or part of it, such as mumbai rajdhani or vande bharat, or the start of a train number. |

## Example request

```bash
curl "https://api.toolzerhub.com/v1/indianrail/trains/search?query=<query>" \
  -H "x-api-key: $TOOLZERHUB_API_KEY"
```

Success responses are wrapped as `{ "data": ... }`. Errors return `{ "error": { "code", "status", "message", "retryable", "details" } }`. See https://docs.toolzerhub.com/docs/responses-and-errors.
