Skip to main content
Two things in Stophy come back in pages: parsers that read lists, and the results of a crawl or batch scrape. Paging needs an API key.

Parsers

A parser that reads a list returns cursor or page in data.json when there is more. Send the same request again with that value in the format’s options. This asks for the second page of a Reddit search. The first response had "cursor": "MjQ=".
It returned the next 25 posts and "cursor": "NDk=" for the page after. Keep the URL and the rest of the format the same between pages. The last page has no cursor. A parser that takes page works the same way: send "options": {"page": 2}, then 3, until the results are empty. Each parser’s options are on its parser page and in the parser list. Each page is a new call and costs the parser’s price.

Crawl and batch scrape

Crawl and batch scrape answer at once with an id. Read the pages with crawl status or batch scrape status. Reading status is free, and it needs the same key. A status answer holds up to 100 finished pages or 2 MB, whichever comes first. This is separate from the limit you sent to crawl, which is how many pages the crawl reads in all. A crawl with limit 30 is usually read in one status call once it is done, and one with limit 250 in three. While the job runs, status is scraping. total is the number of pages found so far, and it grows. completed is how many are finished. data holds the finished pages. next appears only when more finished pages are waiting, so it never leads to an empty data.
  1. Poll the status URL every few seconds until status is completed, failed or cancelled.
  2. Follow next until the answer has none. Each next is a full URL on api.stophy.dev. Call it with the same key.
Batch scrape works the same way at https://api.stophy.dev/v1/batch/scrape/<id>. A crawl and its pages are kept for 24 hours.