Openperplex API Parameters Guide

This guide will help you understand and utilize the various parameters available in the Openperplex API to customize your search queries and responses.

Parameters for search , search_simple, search_stream, search_simple_stream methods

query
string
required

The search query or question you want to ask. This is the primary input for your search.

date_context
string

Optional date for context.

Format example: Today is Monday 16 of September 2024 and the time is 6:36 PM.

If not provided, the API uses the current date of the server.

location
string
default: "us"

Country code for search context. This helps in providing localized results.

pro_mode
boolean
default: "false"

Enable or disable pro mode for more advanced search capabilities.

response_language
string
default: "auto"

Language code for the response. “auto” will auto-detect based on the query.

answer_type
string
default: "text"

Format of the answer. Options: “text”, “markdown”, or “html”.

search_type
string
default: "general"

Type of the search : general or news

verbose_mode
boolean
default: "false"

Long format response if set to true

Parameters for get_website_text , get_website_screenshot, get_website_markdown methods

url
string
required

The URL of the website you want to scrap or get a screenshot from it.

Parameters for query_from_url method

url
string
required

The URL of the website you want to interact with.

query
string
required

The question you want to ask.

response_language
string
default: "auto"

Language code for the response. “auto” will auto-detect based on the query.

answer_type
string
default: "text"

Format of the answer. Options: “text”, “markdown”, or “html”.

Supported Locations

The location parameter accepts various country codes to provide localized search results. Here’s a comprehensive list of supported locations:

🇺🇸 us

🇨🇦 ca

🇬🇧 uk

🇲🇽 mx

🇪🇸 es

🇩🇪 de

🇫🇷 fr

🇵🇹 pt

🇧🇪 be

🇳🇱 nl

🇨🇭 ch

🇳🇴 no

🇸🇪 se

🇦🇹 at

🇩🇰 dk

🇫🇮 fi

🇹🇷 tr

🇮🇹 it

🇵🇱 pl

🇷🇺 ru

🇿🇦 za

🇦🇪 ae

🇸🇦 sa

🇦🇷 ar

🇧🇷 br

🇦🇺 au

🇨🇳 cn

🇰🇷 kr

🇯🇵 jp

🇮🇳 in

🇵🇸 ps

🇰🇼 kw

🇴🇲 om

🇶🇦 qa

🇮🇱 il

🇲🇦 ma

🇪🇬 eg

🇮🇷 ir

🇱🇾 ly

🇾🇪 ye

🇮🇩 id

🇵🇰 pk

🇧🇩 bd

🇲🇾 my

🇵🇭 ph

🇹🇭 th

🇻🇳 vn

Use the appropriate country code to get results relevant to a specific region. For example, use “jp” for Japan-specific results or “br” for Brazil-focused searches.

Supported Languages

The response_language parameter allows you to specify the language of the API response:

auto : auto detect user question language

auto

en

fr

es

de

it

pt

nl

ja

ko

zh

ar

ru

tr

hi

Response Structure

Depending on the method you use, the response structure will vary:

search method

llm_response
string

The main response from the language model.

images
array

A list of relevant images (if available).

sources
array

A list of sources used to generate the response.

relevant_questions
array

A list of related questions that might be of interest.

response_time
string

The response time.

search_simple method

llm_response
string

The main response from the language model.

response_time
string

The response time.

search_stream method

The streaming response is divided into chunks, each with a type field:

llm
object
sources
object
images
object
relevant_questions
object

search_simple_stream method

The streaming response is divided into chunks, each with a type field:

llm
object

get_website_screenshot method

url
string

The URL where the screenshot can be accessed.

response_time
string

The response time.

get_website_text method

text
string

The TEXT extracted from URL

response_time
string

The response time.

get_website_markdown method

markdown
string

The TEXT in MARKDOWN format extracted from URL

response_time
string

The response time.

query_from_url method

llm_response
string

The LLM response

response_time
string

The response time.

Best Practices

By understanding and effectively using these parameters, you can maximize the power of the Openperplex API in your applications. Happy coding!