# Lookup by path

Turn a path of slugs back into the make, model, generation and version it names.

## Resolve a path

`GET /v1/lookup`

Every resource carries a `path`, such as `volkswagen/golf/viii-facelift-2024`. This endpoint walks it from the make down and returns each level it resolves, which is what a website needs to turn a URL into records in one request.

**Request**

```bash
curl "https://autospec.launchit.ro/v1/lookup?path=volkswagen/golf/viii-facelift-2024" \
  -H "X-API-Key: as_live_your_key"
```

**Response**

```json
{
  "make": {
    "id": 1,
    "path": "volkswagen",
    "slug": "volkswagen",
    "name": "Volkswagen",
    "country": "Germany",
    "website": null,
    "logo_url": "/v1/makes/volkswagen/logo",
    "logo_dark_url": "/v1/makes/volkswagen/logo/dark",
    "popular_for": ["car"],
    "tier": "mainstream",
    "markets": ["europe", "north_america", "china"],
    "model_count": 86,
    "notes": null,
    "updated_at": "2026-09-17T05:10:53.673095"
  },
  "model": {
    "id": 1,
    "path": "volkswagen/golf",
    "slug": "golf",
    "name": "Golf",
    "vehicle_type": "car",
    "make": { "id": 1, "path": "volkswagen", "name": "Volkswagen" },
    "production": { "start": 1974, "end": null },
    "generation_count": 39,
    "notes": null,
    "updated_at": "2026-09-03T22:53:36.333479"
  },
  "generation": {
    "id": 111,
    "path": "volkswagen/golf/viii-facelift-2024",
    "name": "VIII (facelift 2024)"
  }
}
```

The example is shortened: each level comes back in full, exactly as its own endpoint returns it.

## Parameters

| Parameter | Required | Description |
|---|---|---|
| `path` | Either this or `make` | One to four slugs joined by `/`: make, model, generation, version. |
| `make` | Either this or `path` | The make's slug. |
| `model` | Optional | The model's slug within that make. |
| `generation` | Optional | The generation's slug within that model. |
| `version` | Optional | The version's slug within that generation. |

## As far as it resolves

The answer holds every level that was found, in order, and stops at the first that was not. A path whose model does not exist returns the make alone, and a path whose make does not exist returns `{}`. That is a `200`, not a `404`: finding where a path stops is the answer.

Slugs can change when a record is renamed. Store the `id` for anything you need to find again, and use paths for URLs.
