# URLs with reserved characters throws error in search\_domain\_filter

**URL:** <https://community.perplexity.ai/t/urls-with-reserved-characters-throws-error-in-search-domain-filter/3498>\
**Category:** Bug Reports\
**Created:** [January 13, 2026, 5:47pm UTC](https://community.perplexity.ai/t/urls-with-reserved-characters-throws-error-in-search-domain-filter/3498 "2026-01-13T17:47:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mulvad](https://sea1.discourse-cdn.com/flex001/user_avatar/community.perplexity.ai/mulvad/32/2414_2.png) [@mulvad](https://community.perplexity.ai/u/mulvad)\
**Post date:** [January 13, 2026, 5:47pm UTC](https://community.perplexity.ai/t/urls-with-reserved-characters-throws-error-in-search-domain-filter/3498/1 "2026-01-13T17:47:39Z")

</div>

## 🐛 Describe the Bug

If I pass this URL in search\_domain\_filter: [https://seinfeld.fandom.com/wiki/The\_Seinfeld\_Chronicles](https://seinfeld.fandom.com/wiki/The_Seinfeld_Chronicles) the [https://api.perplexity.ai/chat/completions](https://api.perplexity.ai/chat/completions) works fine. If I instead use this URL: [https://en.wikipedia.org/wiki/The\_Stake\_Out\_(Seinfeld)](https://en.wikipedia.org/wiki/The_Stake_Out_(Seinfeld)) I get this error: {“error”:{“message”:“Validation error: search\_domain\_filters must be a valid domain name, but got [https://en.wikipedia.org/wiki/The\_Stake\_Out\_%2528Seinfeld%2529",“type”:“invalid\_search\_domain\_filter”,"code](https://en.wikipedia.org/wiki/The_Stake_Out%5C_%2528Seinfeld%2529%22,%22type%22:%22invalid_search_domain_filter%22,%22code)”:400}}

## ✅ Expected Behavior

The URL would work as other URLs work

## ❌ Actual Behavior

The error as described above.

## 🔄 Steps to Reproduce

1. Call the API with the following request: As described above
2. Observe the unexpected behavior.

---

<div class="post-metadata">

**Author:** ![mulvad](https://sea1.discourse-cdn.com/flex001/user_avatar/community.perplexity.ai/mulvad/32/2414_2.png) [@mulvad](https://community.perplexity.ai/u/mulvad)\
**Post date:** [January 22, 2026, 11:44pm UTC](https://community.perplexity.ai/t/urls-with-reserved-characters-throws-error-in-search-domain-filter/3498/3 "2026-01-22T23:44:08Z")

</div>

Here is an example of two similar Perplexity API queries: one that works successfully and one that fails due to a validation error in the `search_domain_filter` field.

* * *

## Working Query

The following query executes successfully:

```bash
curl --location 'https://api.perplexity.ai/chat/completions' \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --header "Authorization: Bearer $SONAR_API_KEY" \
  --data '{
    "model": "sonar",
    "messages": [
      {
        "role": "user",
        "content": "Give a short summary of Seinfeld episode 1 season 1"
      }
    ],
    "search_domain_filter": [
      "https://en.wikipedia.org/wiki/The_Seinfeld_Chronicles",
      "https://www.imdb.com/title/tt0098286/"
    ]
  }' | jq

```

**Result:**  
The query works as expected.

* * *

## Failing Query

The following query uses a similar structure but fails:

```bash
curl --location 'https://api.perplexity.ai/chat/completions' \
  --header 'accept: application/json' \
  --header 'content-type: application/json' \
  --header "Authorization: Bearer $SONAR_API_KEY" \
  --data '{
    "model": "sonar",
    "messages": [
      {
        "role": "user",
        "content": "Give a short summary of Seinfeld episode 2 season 1"
      }
    ],
    "search_domain_filter": [
      "https://en.wikipedia.org/wiki/The_Stake_Out_(Seinfeld)",
      "https://www.imdb.com/title/tt0697784/"
    ]
  }' | jq

```

* * *

## Error Response

The failing query returns the following error:

```json
{
  "error": {
    "message": "Validation error: search_domain_filters must be a valid domain name, but got https://en.wikipedia.org/wiki/The_Stake_Out_(Seinfeld)",
    "type": "invalid_search_domain_filter",
    "code": 400
  }
}

```

* * *

## Note

- The failing URL includes parentheses, which may trigger stricter validation.
