Web Search API

Get enhanced search details from billions of web documents, including news, images, videos, and more.

1. API Overview

The Web Search API allows you to search for any web page information and URLs across the internet, providing accurate results with complete summaries. This API is optimized for AI applications and delivers results that are highly relevant and well-suited for machine processing.

2. Search Results

The Web Search API returns results in the following categories:

  • Web Pages: Includes information such as title, URL, snippet, summary, site name, and site icon.

The response format is compatible with Bing Search API.

3. API Endpoint

  • API Domain: https://api.langsearch.com

  • Endpoint: https://api.langsearch.com/v1/web-search

4. Request Method

  • Method: POST

5. Request Parameters

Request Headers

Parameter
Value
Description

Authorization

Bearer {API KEY}

Authentication parameter. Example: Bearer xxxxxx. API KEY can be obtained from the LangSearch API Dashboard (https://langsearch.com/dashboard) > API Key Management.

Content-Type

application/json

Specifies the format of the request body.

Request Body Parameters

Parameter
Type
Required
Description

query

String

Yes

The user's search query.

freshness

String

No

Specifies the time range for search results. Possible values: - oneDay: Results from the past 24 hours. - oneWeek: Results from the past week. - oneMonth: Results from the past month. - oneYear: Results from the past year. - noLimit: No time filter (default).

summary

Boolean

No

Whether to show long text summaries for results. Possible values: - true: Show summaries. - false: Do not show summaries (default).

count

Integer

No

The number of results to return. Possible range: 1-10 (default is 10).

6. Response Content

The response will contain the following fields:

SearchData

  • _type: "SearchResponse"

  • queryContext: Information about the search query.

  • webPages: List of web search results.

QueryContext

  • originalQuery: The original search query provided by the user.

WebPages

  • webSearchUrl: The URL of the search result.

  • totalEstimatedMatches: The estimated total number of results.

  • value: A list of web pages returned in the search results.

  • someResultsRemoved: Whether some results were removed due to restrictions.

WebPageValue

  • id: Unique identifier for the web page.

  • name: The title of the webpage.

  • url: The URL of the webpage.

  • displayUrl: The decoded version of the webpage URL.

  • snippet: A brief snippet from the web page.

  • summary: Full summary (only when summary=true).

  • datePublished: The date the page was published.

  • dateLastCrawled: The last date the page was crawled.

7. Example Request

Request Body:

Response:

8. SDKs

cURL

Python

Last updated