Web scraping ethics means making choices that are fair to a site, to its operator and to the people named on its pages, and most of those choices are made before the first request. Answer five questions first: has the site said no, can the operator tell who you are, how hard will you load the server, how much do you need, and what will you keep?
Law sets a floor under some of these answers. The rest is conduct no court will check, and that part is up to you. This page is not legal advice. For each question it names the field of the request body that carries part of the answer, and says where the field stops and a person has to decide.
A tool sends some answer even when you set nothing, because its defaults count. That holds for every web scraping job, whatever program sends it. Write down the parts a field can carry, so a reviewer can read them off the request, and keep the parts a person decided in notes next to it.
The checklist
- Has the site said no? A site says no in two places. Its robots.txt may disallow the paths you want, and the
respect_robotsfield tells the client to follow that file. Its terms of service may rule out automated access, and no field reads those. A person reads them, and asks the operator when the answer is unclear. Following robots.txt is not the same as having permission. A site can also say no while the job runs, by refusing requests or by showing a CAPTCHA. Either one is an answer. Stop the job and ask the operator for access, instead of trying again. How to read the file yourself is on the robots.txt page. - Can the operator tell who is asking, and reach you? The field is
user_agent. A name, a page about the job and a mailbox let an operator write to you instead of blocking you. The field carries the words, and someone still has to read the mailbox it names. What an operator can and cannot check is on the page about identifying your crawler. - How much load does the job add to a server you do not run? The
delayfield sets a wait between requests. Picking the number is your call, and the request rate page shows how to pick one and what it costs in time. - How much do you need? The
limitfield caps the pages one crawl fetches. The API reference describes it as "Maximum pages to crawl per site. Unset or 0 crawls every page found, capped by your … remaining credit balance." Leaving it out removes the page cap you chose, and then your balance sets the size of the job instead of your purpose. The number itself comes from a person who knows what the job is for. - What will you keep, and whose is it? No field answers this one.
return_formatsets the form each page comes back in, such as plain text instead of HTML. It does not choose which facts the job collects or how long you store them. Decide that before the first request: write down the fields the job needs, the addresses it should fetch, and when the raw pages get deleted. Filtering after the crawl cannot undo a fetch you did not need. The question covers two kinds of material. The first is personal data. The UK Information Commissioner's Office, in its guidance on data minimisation, tells organisations "You must not collect personal data on the off-chance that it might be useful in the future." The second is someone else's writing, photos or code. In US copyright law, the fair use test at 17 U.S.C. 107 weighs "the amount and substantiality of the portion used in relation to the copyrighted work as a whole", next to "the effect of the use upon the potential market for or value of the copyrighted work". Taking less, and keeping what the purpose needs and no more, helps on both counts.
The checklist as one request
Here are the five answers for a small job: the poetry shelf of Books to Scrape, a shop whose stock is made up. On every page the site carries its own answer to the first question, a banner that reads "This is a demo website for web scraping purposes". On a real site you would get that answer from its terms, or by writing to the operator.
Question five gets its answer on paper first. The job needs two fields from each poetry book: its title and the address of its page. It should fetch the poetry shelf and the book pages listed on it, and nothing else. The raw text of each page is deleted once those two fields are copied out, the same day as the run. The request below cannot carry any of that, so it lives in the job's notes.
The call needs a key in the SPIDER_API_KEY environment variable. The body is printed as it was sent, one field to a line.
curl -s https://api.spider.cloud/crawl \
-H "Authorization: Bearer $SPIDER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://books.toscrape.com/catalogue/category/books/poetry_23/index.html",
"limit": 5,
"request": "http",
"return_format": "text",
"respect_robots": true,
"delay": 1000,
"user_agent": "examplebot/1.0 (+https://example.com/bot; bot@example.com)"
}'Read it from the top.
urlis the shelf where the job starts. It is not one of the answers, but question one is about this site, so the terms and the robots.txt you checked belong to this host.limitset to 5 is the size picked for question four. Five pages is enough to test what the job collects before you run it at full size.requestset tohttppicks the fetch mode that runs no JavaScript. A static catalogue needs nothing more. It says nothing about the scheme; the address itself is HTTPS.return_formatset totextasks for each page as plain words, without markup. That makes the response easier to check, but question five is still open: what you store from that text is decided after it arrives.respect_robotsset totruecovers the robots.txt half of question one. The reference gives true as the default, so the line changes nothing on its own. It is there so a reviewer can see it. The terms half came from a person reading the site's banner, quoted above.delayset to 1000 asks for one second between requests, the number picked for question three.user_agentcarries question two. It names the client, links a page about it and gives an address to write to. Both the page and the address here are placeholders. Before you crawl a real site, replace them with a real page about your bot and a mailbox someone reads.
What came back
Six seconds before the crawl, at 23:35:20 UTC, we looked up https://books.toscrape.com/robots.txt once with the same user agent. It answered 404: at that moment the site had no robots.txt.
The crawl itself ran, at 23:35:26 UTC on 2026-11-20. It returned five pages, and the whole call took 6.6 seconds. Each page also had a content field, left out here.
[
{"url": "https://books.toscrape.com/catalogue/category/books/poetry_23/index.html", "status": 200, "error": null},
{"url": "https://books.toscrape.com/catalogue/category/books/young-adult_21/index.html", "status": 200, "error": null},
{"url": "https://books.toscrape.com/catalogue/poems-that-make-grown-women-cry_824/index.html", "status": 200, "error": null},
{"url": "https://books.toscrape.com/catalogue/category/books/music_14/index.html", "status": 200, "error": null},
{"url": "https://books.toscrape.com/catalogue/category/books/novels_46/index.html", "status": 200, "error": null}
]The text of the first page opens with these two lines. Its third line starts with the site's demo warning and runs on into the book list, so it is left out.
Poetry | Books to Scrape - Sandbox
Home Books Poetry 19 results.The output bears out some settings and shows a gap in one.
The limit held. Five pages came back, all with status 200 and a null error, and the run stopped there.
The delay was set to one second. The output gives the total, 6.6 seconds for the call, and does not time each request, so it cannot show the gaps one by one.
The robots.txt setting had nothing to act on. The lookup before the crawl found no file. RFC 9309 says that when the file is unavailable, "the crawler MAY access any resources on the server." So the field was set and the site gave it no rule, and this run cannot show the field skipping a path.
The scope answer was wrong, measured against the notes. The job wanted poetry, and two of the five pages are poetry: the shelf itself and one book on it. The other three are the shelves for young adult, music and novels. A start address does not keep a crawl inside one section. Here the limit kept the extra small, but three of the five pages were text the job had no use for. On a site with real people on its pages, that is how a scraper ends up holding personal data it did not mean to collect.
Do this, avoid this
Do this
- Read the site's terms before the first request, and write to the operator when they rule out automated access.
- Write down what the job is for, then name the fields you will store and why each one serves that purpose.
- Run a small crawl first and check every address it returned against what the job needs.
- Delete pages and fields the job does not use, and set a date to check again.
Avoid this
- Storing names, emails or profiles because they happened to be on a page you fetched.
- Republishing whole articles, photos or listings when a short extract or a link would do.
- Leaving the limit unset on a site you have not crawled before.
- Keeping a copy of a site whose terms you have not read.
This run needs one more field before it grows. The reference lists whitelist and describes it as "Paths to allow. Everything else is skipped." The poetry book's address does not sit under the shelf's path, so a pattern for the shelf alone would drop the books. Write one that covers both, run the five pages again, and go larger once every address that comes back is one you meant to collect.
Sources
- Books to Scrape, a demo shop for scraping practice Read
- RFC 9309, Robots Exclusion Protocol, section 2.3.1.3, IETF, September 2022 Read
- UK Information Commissioner's Office, Principle (c): Data minimisation Read
- 17 U.S.C. 107, Limitations on exclusive rights: Fair use, Cornell Legal Information Institute Read
- Spider OpenAPI file, the limit and whitelist parameters Read