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

# Filtering & Search

> Narrow down contracts and suppliers using filters and full-text search

The API supports filtering by related entities and full-text keyword search across contracts and suppliers.

## Text search

Use the `q` parameter to search by keyword (max 200 characters):

```bash theme={null}
# Search contracts
curl "https://prod-api.civicmarketplace.com/v1/contracts?q=office+supplies" \
  -H "Authorization: Bearer cmp_live_YOUR_KEY"

# Search suppliers
curl "https://prod-api.civicmarketplace.com/v1/suppliers?q=Acme" \
  -H "Authorization: Bearer cmp_live_YOUR_KEY"
```

## Filtering contracts

Contracts can be filtered by their related entities using opaque IDs:

| Parameter      | Description                     | Example                   |
| -------------- | ------------------------------- | ------------------------- |
| `lead_entity`  | Filter by lead entity           | `?lead_entity=le_abc123`  |
| `coop`         | Filter by cooperative           | `?coop=co_def456`         |
| `supplier`     | Filter by supplier              | `?supplier=sup_ghi789`    |
| `city_service` | Filter by city service category | `?city_service=cs_jkl012` |

### Getting filter IDs

Use the taxonomy endpoints to look up valid IDs:

```bash theme={null}
# List all lead entities
curl "https://prod-api.civicmarketplace.com/v1/lead-entities" \
  -H "Authorization: Bearer cmp_live_YOUR_KEY"

# List all cooperatives
curl "https://prod-api.civicmarketplace.com/v1/coops" \
  -H "Authorization: Bearer cmp_live_YOUR_KEY"

# List all city services
curl "https://prod-api.civicmarketplace.com/v1/city-services" \
  -H "Authorization: Bearer cmp_live_YOUR_KEY"
```

## Combining filters

You can combine filters with search and date ranges:

```bash theme={null}
# Contracts from a specific coop, updated in the last week, matching "consulting"
curl "https://prod-api.civicmarketplace.com/v1/contracts?coop=co_def456&q=consulting&updated_since=2026-04-15T00:00:00Z" \
  -H "Authorization: Bearer cmp_live_YOUR_KEY"
```

## Date filtering

Use `updated_since` (ISO 8601 format) to get records modified after a specific time:

```bash theme={null}
# Contracts updated after April 1, 2026
curl "https://prod-api.civicmarketplace.com/v1/contracts?updated_since=2026-04-01T00:00:00Z" \
  -H "Authorization: Bearer cmp_live_YOUR_KEY"
```

<Tip>
  Combine `updated_since` with cursor pagination for efficient incremental syncing. See the [Syncing
  Data](/guides/syncing-data) guide.
</Tip>
