> ## Documentation Index
> Fetch the complete documentation index at: https://docs.licensesearcher.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Search by Name or Address

> Find liquor licenses by business name, owner, or street address.

Search a state's government databases for liquor licenses by business name, owner, or street address. Matching is case-insensitive and accepts partial input.

```bash theme={null}
GET /v2/search
```

## Query parameters

<ParamField query="state" type="string" required>
  The two-digit USPS state code (for example, `ny`). Must be a [supported state](/supported-states) your key is scoped to. Unsupported states return a `404`.
</ParamField>

<ParamField query="name" type="string">
  The full or partial, case-insensitive business or owner name to search for. Required if `address` is not provided. Cannot be used together with `address`.
</ParamField>

<ParamField query="address" type="string">
  The full or partial, case-insensitive address line 1 to search for. Required if `name` is not provided. Cannot be used together with `name`.
</ParamField>

<Note>
  Provide exactly one of `name` or `address`. Supplying both, or neither, returns a `400`.
</Note>

## Returns

Returns an array of up to **10** [license objects](/liquor-licenses/license-object) if the call succeeds. Pagination is not currently supported.

<RequestExample>
  ```bash cURL theme={null}
  curl "https://api.licensesearcher.com/v2/search?state=ny&name=bernardin" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```javascript JavaScript theme={null}
  const params = new URLSearchParams({ state: "ny", name: "bernardin" });
  const res = await fetch(
    `https://api.licensesearcher.com/v2/search?${params}`,
    { headers: { Authorization: "Bearer YOUR_API_KEY" } }
  );
  if (!res.ok) throw new Error(`Request failed: ${res.status}`);
  const data = await res.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  res = requests.get(
      "https://api.licensesearcher.com/v2/search",
      params={"state": "ny", "name": "bernardin"},
      headers={"Authorization": "Bearer YOUR_API_KEY"},
  )
  res.raise_for_status()
  print(res.json())
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "data": [
      {
        "license": "1026288",
        "object": "license",
        "address": {
          "city": "NEW YORK",
          "county": "NEW YORK",
          "line_1": "787 7TH AVENUE",
          "line_2": "THE EQUITABLE TOWER CENTER",
          "state": "NY",
          "zip": "10019"
        },
        "business": "LE BERNARDIN",
        "dates": {
          "ny": {
            "effective": "2023-01-01",
            "expires": "2024-12-31",
            "issued_latest": null,
            "issued_original": "2022-11-29"
          }
        },
        "details": {
          "class": null,
          "description": null,
          "type": "OP"
        },
        "owner": "LE BERNARDIN INC",
        "phone": null,
        "state": "ny",
        "status": "active",
        "updated_at": "2023-10-31 21:41:50.555399"
      }
    ]
  }
  ```
</ResponseExample>
