Call it
curl https://api.peume.com/v1/call/search-the-web-and-extract-a-structured-answer \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"query": "example pricing",
"numResults": 1,
"prompt": "Return the listed one-time price of the smallest credit pack.",
"format": "markdown",
"allowedTypes": [
"text/html"
]
}
}'const res = await fetch("https://api.peume.com/v1/call/search-the-web-and-extract-a-structured-answer", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"query": "example pricing",
"numResults": 1,
"prompt": "Return the listed one-time price of the smallest credit pack.",
"format": "markdown",
"allowedTypes": [
"text/html"
]
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/search-the-web-and-extract-a-structured-answer",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"query": "example pricing",
"numResults": 1,
"prompt": "Return the listed one-time price of the smallest credit pack.",
"format": "markdown",
"allowedTypes": [
"text/html"
]
}
},
)
print(res.json()["output"])Answer: {"id": "run_…", "status": "completed", "cost_usd": …, "output": {…}}. Long jobs answer 202 with a run id to read later. From an AI agent, connect the MCP server and ask for this by name: search-the-web-and-extract-a-structured-answer.
Parameters
queryRequiredstringExample: example pricing
numResultsintegerExample: 1
promptRequiredstringExample: Return the listed one-time price of the smallest credit pack.
schemaobjectOptional JSON Schema for the top-level json field.
formatRequiredstringmarkdown
Example: markdown
timeRangestringpast_hour · past_24_hours · past_week · past_month · past_year
locationGeoCodestringISO 3166-1 alpha-2 country code.
allowedTypesRequiredarrayExample: ["text/html"]
Other ways to do it
Same job, other sources, cheapest first.
