For AI agents: docs.octen.ai/resources/migrate-from-serper.md
Endpoint Map
| Serper | Octen |
|---|---|
Search (POST /search) | Web Search |
News (POST /news) | News Search |
Images (POST /images) | Image Search |
Lens (POST /lens) | Image Search with an image input |
Videos (POST /videos) | Video Search (invite-only beta) |
Places (POST /places) | Place Search |
Maps (POST /maps) | Place Search |
Webpage (POST https://scrape.serper.dev) | Extract |
Authentication
| Serper | Octen | |
|---|---|---|
| Base URL | https://google.serper.dev (Webpage: https://scrape.serper.dev) | https://api.octen.ai |
| Auth header | X-API-KEY: <key> | x-api-key: <key> or Authorization: Bearer <key> |
Web Search
Request Parameters
| Serper | Octen |
|---|---|
q | query (up to 500 characters). Supported operators: site:, -site:, before:, after:, OR, and "<words>", which matches pages containing every quoted word. |
num | count (1-100, default 5) |
tbs (qdr:d, qdr:w, qdr:m, or qdr:y) | time_range (day, week, month, or year) |
Response Fields
| Serper | Octen |
|---|---|
searchParameters.q | data.query |
organic | data.results |
organic[].title | data.results[].title |
organic[].link | data.results[].url |
organic[].snippet | data.results[].highlight (query-relevant; highlight.max_tokens sets the length) |
organic[].date | data.results[].time_published (ISO 8601) |
message (on errors) | msg, with a nonzero code |
Code
import os
import requests
url = "https://google.serper.dev/search"
payload = {"q": "coffee", "num": 10, "tbs": "qdr:m"}
headers = {"X-API-KEY": os.environ["SERPER_API_KEY"], "Content-Type": "application/json"}
response = requests.request("POST", url, headers=headers, json=payload)
for result in response.json()["organic"]:
print(result["title"], result["link"])
print(result.get("snippet"))
import os
from octen import Octen
client = Octen(api_key=os.environ["OCTEN_API_KEY"])
response = client.search.search(
query="coffee",
count=10,
time_range="month",
)
for result in response.results:
print(result["title"], result["url"])
print(result.get("highlight"))
News Search
Request Parameters
| Serper | Octen |
|---|---|
q | query (up to 500 characters). Supported operators: site: and -site:. |
num | count (1-100, default 5) |
tbs (qdr:d, qdr:w, qdr:m, or qdr:y) | time_range (day, week, month, or year) |
Response Fields
| Serper | Octen |
|---|---|
news | data.results |
news[].title | data.results[].title |
news[].link | data.results[].url |
news[].snippet | data.results[].highlight |
news[].source | data.results[].authors (website name or author) |
news[].date (such as "2 weeks ago") | data.results[].time_published (ISO 8601) |
news[].imageUrl | data.results[].cover_image.url |
message (on errors) | msg, with a nonzero code |
Code
import os
import requests
url = "https://google.serper.dev/news"
payload = {"q": "SpaceX Starship", "num": 10, "tbs": "qdr:w"}
headers = {"X-API-KEY": os.environ["SERPER_API_KEY"], "Content-Type": "application/json"}
response = requests.request("POST", url, headers=headers, json=payload)
for result in response.json()["news"]:
print(result["title"], result["link"], result.get("source"), result.get("date"))
import os
from octen import Octen
client = Octen(api_key=os.environ["OCTEN_API_KEY"])
response = client.search.news_search(
query="SpaceX Starship",
count=10,
time_range="week",
)
for result in response.results:
print(result["title"], result["url"], result.get("authors"), result.get("time_published"))
Image Search
Request Parameters
| Serper | Octen |
|---|---|
q | inputs with one text input, {"type": "text", "data": "<query>"} (query in the Python SDK) |
url (/lens) | inputs with one image input, {"type": "image", "url": "<image URL>"} (image_url in the Python SDK) |
num | count (1-10, default 5) |
Response Fields
| Serper | Octen |
|---|---|
images | data.results |
images[].title | data.results[].title |
images[].imageUrl | data.results[].url |
images[].imageWidth, images[].imageHeight | data.results[].width, data.results[].height |
images[].thumbnailUrl | data.results[].thumbnail |
images[].link | data.results[].source_page |
message (on errors) | msg, with a nonzero code |
Code
import os
import requests
url = "https://google.serper.dev/images"
payload = {"q": "lion", "num": 10}
headers = {"X-API-KEY": os.environ["SERPER_API_KEY"], "Content-Type": "application/json"}
response = requests.request("POST", url, headers=headers, json=payload)
for result in response.json()["images"]:
print(result["title"], result["imageUrl"], result["link"])
import os
from octen import Octen
client = Octen(api_key=os.environ["OCTEN_API_KEY"])
response = client.image_search.search(
query="lion",
count=10,
)
for result in response.results:
print(result["title"], result["url"], result["source_page"])
Video Search
Request Parameters
| Serper | Octen |
|---|---|
q | inputs with one text input, {"type": "text", "data": "<query>"} (query in the Python SDK) |
num | count (1-10, default 5) |
tbs (qdr:d, qdr:w, qdr:m, or qdr:y) | time_range (day, week, month, or year), filtered by publish time |
Response Fields
| Serper | Octen |
|---|---|
videos | data.results |
videos[].title | data.results[].title |
videos[].link | data.results[].url |
videos[].snippet | data.results[].description (server-generated description of the video content) |
videos[].imageUrl | data.results[].cover_url |
videos[].duration (such as "2:22:33") | data.results[].duration_seconds (an integer) |
videos[].channel | data.results[].authors (website name or author) |
videos[].date | data.results[].time_published (ISO 8601) |
message (on errors) | msg, with a nonzero code |
Code
import os
import requests
url = "https://google.serper.dev/videos"
payload = {"q": "how to make fresh pasta", "num": 10}
headers = {"X-API-KEY": os.environ["SERPER_API_KEY"], "Content-Type": "application/json"}
response = requests.request("POST", url, headers=headers, json=payload)
for result in response.json()["videos"]:
print(result["title"], result["link"], result.get("duration"))
import os
from octen import Octen
client = Octen(api_key=os.environ["OCTEN_API_KEY"])
response = client.video_search.search(
query="how to make fresh pasta",
count=10,
)
for result in response.results:
print(result["title"], result["url"], result.get("duration_seconds"))
Place Search
Request Parameters
| Serper | Octen |
|---|---|
q | query (up to 500 characters) |
location (/places, such as "Austin, Texas, United States") | user_location with type: "approximate" and city, region, country (country as an ISO 3166-1 alpha-2 code or free text) |
ll (/maps, @latitude,longitude,zoom) | latitude, longitude (provide both) |
Response Fields
| Serper | Octen |
|---|---|
places | data.places |
places[].title | data.places[].name |
places[].category (/places), places[].type (/maps) | data.places[].category |
places[].address | data.places[].address |
places[].latitude, places[].longitude | data.places[].latitude, data.places[].longitude |
places[].phoneNumber | data.places[].phone (international format) |
places[].website | data.places[].website |
places[].rating | data.places[].rating (out of 5) |
ll (/maps) | data.location (latitude and longitude of the search center) |
message (on errors) | msg, with a nonzero code |
Code
import os
import requests
url = "https://google.serper.dev/places"
payload = {"q": "coffee shops", "location": "Austin, Texas, United States"}
headers = {"X-API-KEY": os.environ["SERPER_API_KEY"], "Content-Type": "application/json"}
response = requests.request("POST", url, headers=headers, json=payload)
for place in response.json()["places"]:
print(place["title"], place.get("address"), place.get("rating"))
import os
from octen import Octen
client = Octen(api_key=os.environ["OCTEN_API_KEY"])
response = client.place_search.search(
query="coffee shops",
user_location={"type": "approximate", "city": "Austin", "region": "Texas", "country": "US"},
places={"count": 10},
)
for place in response.places:
print(place["name"], place.get("address"), place.get("rating"))
Extract
Request Parameters
| Serper | Octen |
|---|---|
url | urls (up to 20 URLs, each up to 2,048 characters) |
includeMarkdown | format (markdown or text, default markdown) |
Response Fields
| Serper | Octen |
|---|---|
markdown | data.results[].full_content (with format: "markdown", the default; data.results is response.items in the Python SDK) |
text | data.results[].full_content (with format: "text") |
message (on errors) | msg, with a nonzero code; a failed URL returns status: "failed" and error_message |
Code
import os
import requests
url = "https://scrape.serper.dev"
payload = {"url": "https://en.wikipedia.org/wiki/Coffee", "includeMarkdown": True}
headers = {"X-API-KEY": os.environ["SERPER_API_KEY"], "Content-Type": "application/json"}
response = requests.request("POST", url, headers=headers, json=payload)
print(response.json()["markdown"][:500])
import os
from octen import Octen
client = Octen(api_key=os.environ["OCTEN_API_KEY"])
response = client.extract.extract(
urls=["https://en.wikipedia.org/wiki/Coffee"],
format="markdown",
)
for item in response.items:
if item.status == "success":
print(item.full_content[:500])
else:
print("failed:", item.url, item.error_message)
Last modified on November 24, 2026