How do I restrict Perplexity Search API sources by language?

The Citead team, updated

In short. Set search_language_filter to an array of lowercase ISO 639-1 codes to select source languages in a Perplexity Search API request.

Definition: As of October 2026, Perplexity's Search API provides search_language_filter, an optional request parameter that restricts returned web content to specified languages. It accepts an array of lowercase ISO 639-1 language codes, such as ["en", "fr"] for English and French.

Key facts

Which values does the filter accept?

Perplexity's language guide defines the field as an array of strings. Each string uses the ISO 639-1 system of two-letter language codes. Its common-code table includes these values:

LanguageValue
Englishen
Frenchfr
Germande
Spanishes
Portuguesept
Chinesezh
Japaneseja
Koreanko

The same guide requires lowercase codes and says invalid codes produce an API error. A single-language restriction still uses an array: ["fr"] selects French content. Regional strings such as fr-FR fall outside the required two-letter format.

The guide gives a limit of 10 codes per request, while the API reference schema declares maxItems: 20 for search_language_filter.

How are multiple languages combined?

Perplexity's quickstart language example places the language array directly in the request body sent to https://api.perplexity.ai/search. The following request follows that example and selects English, French or German content:

curl -X POST 'https://api.perplexity.ai/search' \
  -H "Authorization: Bearer $PERPLEXITY_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "query": "explanation of how large language models are trained: pretraining, supervised fine-tuning, and reinforcement learning from human feedback",
    "search_language_filter": ["en", "fr", "de"],
    "max_results": 10
  }'

The quickstart uses PERPLEXITY_API_KEY for authentication. Its Python equivalent passes search_language_filter=["en", "fr", "de"] to client.search.create(). The Search API returns ranked web results as structured data; its examples read each result's title and url from response.results.

Can language filtering work with other restrictions?

Perplexity's language guide states that this filter applies in addition to other search parameters. It recommends combining language selection with search_domain_filter, which restricts source domains, or search_recency_filter, which restricts publication recency. Its news-monitoring example combines a language array with search_recency_filter="day".

The API reference exposes country as a separate field. Language selection uses ISO 639-1 codes; country selection uses ISO 3166-1 alpha-2 codes. The same reference lists title, url and snippet among the returned page fields.

FAQ

How do I request only French sources?

You set "search_language_filter": ["fr"] in the request body. Perplexity's language guide identifies fr as French and requires an array of strings.

Can I combine Japanese and Korean?

You can use ["ja", "ko"] in the same array. The same guide lists both codes and demonstrates a multilingual request containing Chinese, Japanese and Korean.

How do I handle an invalid language code?

The same guide says invalid codes produce an API error. Its Python error-handling example catches BadRequestError and checks that supplied codes are lowercase strings of two letters.

Sources

  1. Perplexity, "Search Language Filter", undated
  2. Perplexity, "Perplexity Search API", undated
  3. Perplexity, "Search the Web", undated

Check how a page reads to answer engines. Open the GEO score analyzer

Test a page and see what to fix first

The analysis usually takes less than 10 seconds and needs no account.

400,000+ pages scored in the public benchmark