Multi-Query Mode in Perplexity Search API Not Working

:bug: Describe the Bug

When using the Perplexity Search API in multi-query mode by passing a list of queries, only results for the first query are returned. Queries beyond the first one are seemingly ignored, despite the documentation suggesting support for multiple independent queries. This occurs regardless of the max_results value or how the request is made (via SDK, API Playground, or direct HTTP request).

:white_check_mark: Expected Behavior

The API should return a balanced mix of results covering all provided queries—e.g., if three queries are given and max_results=10, approximately 3–4 results per query (or at least some representation from each). Each result should be clearly attributable to one of the input queries.

:cross_mark: Actual Behavior

Only results related to the first query in the list are returned. No results correspond to the second or third queries, indicating that the API is not processing the full list of queries as intended.

:counterclockwise_arrows_button: Steps to Reproduce

Call the API with the following request:


from perplexity import Perplexity

client = Perplexity()
search = client.search.create(

query=\[ "renewable energy trends 2024", "solar power innovations", "wind energy developments" \],  max_results=10 )

Observe the unexpected behavior: all results pertain only to “renewable energy trends 2024”, with no mention of solar or wind energy innovations.

:pushpin: API Request & Response (if applicable)

Request Payload:


{ “query”: [ “renewable energy trends 2024”, “solar power innovations”, “wind energy developments” ], “max_results”: 10 }


Response (example):
All results entries are related to general renewable energy trends in 2024; none reflect content specific to solar or wind advancements.

:globe_showing_europe_africa: Environment

  • API Version: [latest search api]

I wasn’t able to reproduce this issue.

Running:

from perplexity import Perplexity

client = Perplexity(api_key="pplx-yourkey")

search = client.search.create(
    query=["renewable energy trends 2024", "solar power innovations", "wind energy developments"],
    max_results=10,
)

for result in search.results:
    print(result.title)
    print(result.url)
    print("--------------------------------")

I’m seeing a healthy mix of results, including several solar-related ones!

Keep in mind the Search API uses a ranked index, so when you pass multiple queries, the most relevant and prominent results tend to rise to the top. If you set a low max_results like 10, you’ll mostly see results weighted toward the strongest query matches — it’s expected behavior for a relevance-ranked search engine.

While the code you show generates a response to requests for similar topics, if you do a multi-query search for dissimilar topics, it will always generate results only for the first query, it’s as if it only takes query[0]. It’s not using all the queries, but only the first one in the list.