Appearance
Search
Run a web search and receive clean Markdown content of the top results.
Description
Use the /search
endpoint to run a web search and receive the most relevant text content of the results.
- The top web search results are automatically scraped.
- The result is cleaned (e.g., removing ads, headers, footers, etc.) and returned in Markdown format.
- Specify
max_tokens
to restrict the output length. We apply a reranking model to the content, so that only the paragraphs that are most relevant to the query are returned in the result.
Arguments
query
: str
- the search term
max_tokens
: int
- max token length of the answer. Default: None
domain
: str
- restrict search to domain, e.g., wikipedia.org.
max_sources
: int
- maximum number of search results returned. Default: 3
search_type
: web
or news
. Use web
for a full web search, or news
to restrict to news articles.
date_range
: any
, h
, d
, w
, m
, or y
. Restrict age of search results. Default: any
.
Usage
python
import requests
import json
api_key = 'YOUR_API_KEY'
payload = json.dumps({
'query': 'apple founders',
'max_tokens': 2000,
'max_sources': 3
})
headers = {'Authorization': f'Bearer {api_key}', 'Content-Type': 'application/json'}
response = requests.post('https://api.ivycheck.com/v1/search', headers=headers, data=payload)
print(response.text)
bash
curl -X POST "https://api.ivycheck.com/v1/search" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "apple founders",
"max_tokens": 2000,
"max_sources": 3
}'
js
const url = 'https://api.ivycheck.com/v1/search';
const apiKey = 'YOUR_API_KEY';
fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer " + apiKey,
},
body: JSON.stringify({{
'query': 'apple founders'
}),
})
.then(response => response.text())
.then(data => console.log(data));
js
const axios = require("axios");
const url = "https://api.ivycheck.com/v1/search";
const apiKey = "YOUR_API_KEY";
axios
.post(
url,
{
query: "apple founders",
},
{
headers: {
"Content-Type": "application/json",
Authorization: "Bearer " + apiKey,
},
}
)
.then((response) => console.log(response.data))
.catch((error) => console.error(error));
Response Example
json
{
"response": [
{
"title": "Apple Inc. - Wikipedia",
"link": "https://en.wikipedia.org/wiki/Apple_Inc.",
"markdown": "### 1976–1980: Founding and incorporation..."
},
{
"title": "The Founding of Apple Computer, Inc. - This Month in Business History",
"link": "https://guides.loc.gov/this-month-in-business-history/april/apple-computer-founded",
"markdown": "Apple Computer, Inc. was founded on April 1, 1976, by college dropouts Steve Jobs and Steve Wozniak, who brought to the new company a vision of changing the way people viewed computers...."
}
],
"success": true,
"credits": 5,
"error": null
}