# Search locations

```http
GET https://api.synup.com/api/v4/locations/search
```

This API returns a list of locations that match a given keyword. The search can be performed on the following fields:

- Location Name
- Street Address
- Store ID

If no specific fields are provided, the API will search across all available fields by default.

Source: https://developer.synup.com/api/locations/search-locations

## Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `query` | string | required | Search keyword |
| `fields` | array | optional | Specific fields to search against. If not provided, searches across all fields. |
| `first` | integer | optional | Number of records to fetch from the most recent ones (i.e., from the end). Defaults to 50 if not provided. |
| `last` | integer | optional | Number of records to fetch from the earliest ones (i.e., from the beginning). |
| `after` | string | optional | Cursor to fetch records after |
| `before` | string | optional | Cursor to fetch records before |
| `archived` | string | optional | Filter locations archived true/false |

## Example request

```bash
curl -X GET 'https://api.synup.com/api/v4/locations/search' \
  -H 'Authorization: API YOUR_API_KEY' \
  -H 'Content-Type: application/json'
```

## Responses

| Status | Description |
| --- | --- |
| `200` | Successful response |
