Skip to content
AI Skill Index

Plan a scrape that respects the source

Checks permission and rate limits before writing any code.

Author: Editorial
Sign in to save
I want to collect data from a website. Help me do it properly.

Site: [URL]
What I need: [THE DATA]
How often: [ONE-OFF / RECURRING]

Answer in this order, and the first two come before any code:

1. **Is there an API, an export, or a published dataset?** Check this first — it is faster, more stable and usually permitted.
2. **What do the terms of service and robots.txt say?** If scraping is disallowed, say so and stop. Tell me what a permitted alternative would be.
3. **Personal data?** If the pages contain information about identifiable people, say what that triggers under GDPR before I collect anything.
4. Only then: a plan with a request rate that would not degrade the site, caching so I never fetch the same page twice, and a note on what breaks when the markup changes.

Do not write a scraper for a site that forbids it, and do not suggest ways to evade rate limits or bot detection.

Highlighted parts are placeholders. Replace them before you send.

Worked example

The input is invented for this page. The output shows what the prompt asks for with that input.

Example input (invented)

Site: https://example.org/planning/applications, my local council's planning search. Each application has its own page.

What I need: New planning applications in my town each week: the site address, the description of the works, the date received and the decision status.

How often: Recurring, once a week.

Example output

1. Is there an API, an export or a published dataset? Many councils publish a weekly list of new applications, and some put planning data on an open data portal [VERIFY]. A weekly list gives the address, description and date received with no scraping, which leaves only the decision status to fetch. Search the site for "weekly list" and "open data".

2. Terms of service and robots.txt. I cannot see either from here. Open https://example.org/robots.txt and look for a Disallow line covering /planning/, then check the terms for anything on automated access or reuse. If either forbids it, stop. The permitted alternative is to ask the planning team for the weekly list by email, or to request the data under your country's access-to-information law [VERIFY].

3. Personal data. Planning pages often name the applicant. If you are in the UK or the EU [VERIFY], GDPR applies: you need a lawful basis, and you collect only what the purpose needs. Leave out the applicant and agent names, which you do not need. The site address is personal data too when the site is someone's home. You need it, so keep it, store nothing beyond your four fields, and decide before the first run how long you keep old weeks.

4. The plan, if scraping is allowed

  • One request every 5 seconds at most, at night. 40 new applications then take 200 seconds. The 20 to 40 a week is a guess [VERIFY].
  • Store each page under its application reference and never fetch one twice, except open applications, whose status you fetch again once a week.
  • It breaks when the council changes its planning software. Compare each week's count with the weekly list, so a broken run shows as a wrong number and not as a silent gap.
ShareXLinkedIn

3 of the 17 other prompts filed under Coding & data.

Cookies

We use only the cookies this site needs to work. Optional analytics helps us see which content is worth writing more of — nothing loads until you say yes.

Read the privacy policy