# Look up a model number or barcode

> Finds models by model number or name (q), or one model by a UPC, EAN or GTIN barcode (code). Send one of the two.


`GET https://dev.siteswap.pro/api/v1/catalog/lookup`

Finds models by model number or name (`q`), or one model by a UPC, EAN or GTIN barcode (`code`). Send one of the two.

Needs the `listings:read` scope.

## Parameters

- `marketplace` (query, string): A marketplace key, as `GET /marketplaces` lists them, for example `materials`
- `q` (query, string): A model number or name
- `code` (query, string): A barcode number

## Responses

- 200: OK
- 400: bad_request, key_in_url or invalid_json: the request could not be read
- 401: missing_key or invalid_key: no key, or a key that is not valid or was revoked
- 403: key_pending, key_declined, scope_missing, terms_required or account_unavailable: see Errors
- 404: not_found: nothing here that you may see
- 413: too_large: the body is over 256 KB
- 429: rate_limited or daily_quota: wait for Retry-After seconds

## Response fields

- `models` (object[])
- `models[].id` (string)
- `models[].name` (string)
- `models[].detail` (string | null): More about it, for example the maker
- `models[].maker` (object | null)
- `models[].maker.id` (string)
- `models[].maker.name` (string)
- `models[].type` (object | null)
- `models[].type.id` (string)
- `models[].type.name` (string)
- `models[].category_id` (string | null): A category the model can be posted under
- `models[].source` (string | null): The maker's page it was read from
- `models[].checked` (string | null): The day it was read
- `code` (object | null)
- `code.valid` (boolean): The barcode's check digit is right
- `code.pack` (string | null): The pack the code is printed on
- `code.quantity` (number | null): Pieces in that pack

```json
{
  "data": {
    "models": [
      {
        "id": "string",
        "name": "string",
        "detail": "string",
        "maker": null,
        "type": null,
        "category_id": "string",
        "source": "string",
        "checked": "string"
      }
    ],
    "code": {
      "valid": false,
      "pack": "string",
      "quantity": 0
    }
  },
  "meta": {
    "request_id": "3f9a1c0b7d2e",
    "api_version": "v1"
  }
}
```

## Example

```bash
curl "https://dev.siteswap.pro/api/v1/catalog/lookup" \
  -H "Authorization: Bearer ssk_YOUR_KEY"
```