> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.prolific.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.prolific.com/_mcp/server.

# Search filter choices by keyword

GET https://api.prolific.com/api/v1/filters/{filter_id}/choices/search/

Search choice labels only, rank the complete matching collection, then paginate. Uses the same matching and ordering as global previews: the first three equivalent results equal the global preview. Ranking is conveyed only by array order. Workspace permissions apply before searching or counting. Self, next and previous links preserve the query and workspace context, including workspace_id. Pagination links follow shared API conventions. Empty results retain the same envelope.

Reference: https://docs.prolific.com/api-reference/filters/search-filter-choices

## Authentication

- `Authorization` header (required) (prefixed with ` Token  `) — The Prolific API uses API token to authenticate requests. You can create an API token directly from your settings. Your API token does not have an expiry date and carries full permission, so be sure to keep them secure. If your token is leaked, delete it and create a new one directly in the app. In your requests add `Authorization` header with the value `Token <your token>`.

## Request

### Path parameters

- `filter_id` (string, required) — ID of a filter available in the resolved, permitted catalogue.

### Query parameters

- `q` (string, required) — Trimmed, nonblank keyword query, at most 200 characters after trimming. Text is not a query language. Nonblank input with no searchable characters returns no matches.
- `limit` (integer, optional, default: 25) — Page size. Pagination applies even when this parameter is omitted.
- `offset` (integer, optional, default: 0) — Zero-based result offset. An offset beyond the collection returns an empty page.
- `workspace_id` (string, optional) — Workspace used to resolve accessible filters.

## Response

### 200

Search filter choices by keyword

- `results` (list of FilterChoiceSearchResult, required)
- `meta` (FilterChoiceSearchListMeta, required)
- `_links` (FilterSearchPaginationLinks, required)

## Errors

### 400 Bad Request Error

Missing, blank or oversized q; invalid limit or offset; unsupported choice collection (range or free-entry participant-ID filter); or invalid workspace_id.

- `error` (ErrorDetail, required)

### 403 Forbidden Error

Workspace access denied.

- `error` (ErrorDetail, required)

### 404 Not Found Error

Unknown filter or filter unavailable in the resolved catalogue.

- `error` (ErrorDetail, required)

### 400 Client Request Error

Existing authentication, validation or permission error.

- `error` (ErrorDetail, required)

## Types

### FilterChoiceSearchResult

A selectable choice without children or ancestor paths.

- `id` (string, required) — Existing selection API choice key, always a string.
- `label` (string, required)
- `parent_id` (string, required, nullable) — ID of the immediate parent choice, or null for a root or flat choice.
- `num_children` (integer, required) — Number of immediate children in the filter hierarchy, independent of matches and pagination.
- `num_descendants` (integer, required) — Descendants in the filter hierarchy, excluding this choice. Independent of matches and pagination; flat choices and leaves return zero.
- `matches` (list of FilterChoiceTextMatch, required)

### FilterChoiceSearchListMeta

- `count` (integer, required) — Matching choices before pagination.

### FilterSearchPaginationLinks

- `self` (FilterSearchLink, required)
- `next` (FilterSearchLink, required)
- `previous` (FilterSearchLink, required)
- `last` (FilterSearchLink, required)

### ErrorDetail

- `status` (integer, required) — Status code as in the http standards
- `error_code` (integer, required) — Internal error code
- `title` (string, required) — Error title
- `detail` (ErrorDetailDetail, required) — Error detail
- `additional_information` (string, optional) — Optional extra information
- `traceback` (string, optional) — Optional debug information
- `interactive` (boolean, optional)

### FilterChoiceTextMatch

Offsets apply directly to the returned label. Alias matches refer to the returned country label.

- `field` (enum, required)
  - Allowed values: `label`
- `query_term` (string, required) — Original query term.
- `matched_text` (string, required) — Actual matched display text.
- `start` (integer, required) — Inclusive zero-based Unicode code-point position, not bytes or UTF-16 units.
- `end` (integer, required) — Exclusive zero-based Unicode code-point position.

### FilterSearchLink

- `href` (string, required, nullable) — Link URL, or null when no link is available.
- `title` (string, required)

### ErrorDetailDetail

Error detail

### ErrorDetailDetail2

All fields with validation errors

- `any_field` (list of string, optional) — Name of the field with a validation error and as a value an array with the error descriptions

## Examples

**Response**

```json
{
  "results": [
    {
      "id": "100",
      "label": "Software developers",
      "parent_id": null,
      "num_children": 3,
      "num_descendants": 3,
      "matches": [
        {
          "field": "label",
          "query_term": "developers",
          "matched_text": "developers",
          "start": 9,
          "end": 19
        }
      ]
    },
    {
      "id": "101",
      "label": "Application software developer",
      "parent_id": "100",
      "num_children": 0,
      "num_descendants": 0,
      "matches": [
        {
          "field": "label",
          "query_term": "developers",
          "matched_text": "developer",
          "start": 21,
          "end": 30
        }
      ]
    }
  ],
  "meta": {
    "count": 4
  },
  "_links": {
    "self": {
      "href": "https://api.prolific.com/api/v1/filters/job-title/choices/search/?q=developers&limit=2&offset=0",
      "title": "Current"
    },
    "next": {
      "href": "https://api.prolific.com/api/v1/filters/job-title/choices/search/?q=developers&limit=2&offset=2",
      "title": "Next"
    },
    "previous": {
      "href": null,
      "title": "Previous"
    },
    "last": {
      "href": "https://api.prolific.com/api/v1/filters/job-title/choices/search/?q=developers&limit=2&offset=2",
      "title": "Last"
    }
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.prolific.com/api/v1/filters/filter_id/choices/search/"

querystring = {"q":"q"}

headers = {"Authorization": "Token <token>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript
const url = 'https://api.prolific.com/api/v1/filters/filter_id/choices/search/?q=q';
const options = {method: 'GET', headers: {Authorization: 'Token <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.prolific.com/api/v1/filters/filter_id/choices/search/?q=q"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Token <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.prolific.com/api/v1/filters/filter_id/choices/search/?q=q")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Token <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.prolific.com/api/v1/filters/filter_id/choices/search/?q=q")
  .header("Authorization", "Token <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.prolific.com/api/v1/filters/filter_id/choices/search/?q=q', [
  'headers' => [
    'Authorization' => 'Token <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.prolific.com/api/v1/filters/filter_id/choices/search/?q=q");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Token <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Token <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.prolific.com/api/v1/filters/filter_id/choices/search/?q=q")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```