Use cases
Build a dataset of search results.
Researchers and evaluation teams need large sets of queries with their results. A flat price and plain JSON make that a script, not a project.
How it works
- 1Prepare your queries
A file with one query per line, plus any country or language you want to vary.
- 2Fetch and save
Write each response to disk as it arrives, so a stopped run can pick up where it left off.
- 3Stay under your limit
Pace requests to your per-minute limit, or ask for a higher one for a big run.
Save results for a file of queries
import json, os, time, requests
with open("queries.txt") as f, open("results.jsonl", "a") as out:
for q in map(str.strip, f):
r = requests.get(
"https://plainserp.com/v1/search",
params={"q": q, "num": 20},
headers={"Authorization": f"Bearer {os.environ['PLAINSERP_KEY']}"},
timeout=30,
)
if r.status_code == 429: # over the per-minute limit
time.sleep(int(r.headers.get("Retry-After", 5)))
continue
if r.ok:
out.write(json.dumps(r.json()) + "\n")Why it fits
- The price doesn't change with volume, so a budget is easy to state up front.
- Failed requests aren't charged, so reruns only pay for what's missing.
- Rate-limit headers tell your script exactly when to slow down.
Know before you start
- Results change over time. Record the date with each one.
- Each query reaches 120 results at most.
- Check that your use of the collected results fits the terms and laws that apply to you.
What it costs
Collecting results for 100,000 queries
That is 100,000 searches a run at $0.30 per 1,000. Your first 1,000 are free.
$30.00
a run