Add support for crawl-delay robots.txt directive · Issue #1396 · apify/crawlee-python · GitHub
Skip to content

Add support for crawl-delay robots.txt directive #1396

Open

Description

@vdusek

Summary

RobotsTxtFile.get_crawl_delay() already parses the Crawl-delay directive, but the value is never used to throttle requests. When respect_robots_txt_file=True, the crawler should automatically enforce per-domain delays specified in robots.txt.

Why

  • Respect server capacity limits and avoid IP bans / HTTP 429 responses.
  • Better compatibility with Cloudflare Bot Management and AI Crawl Control — polite crawlers are less likely to be blocked.
  • Cost control with Cloudflare Pay Per Crawl — respecting rate limits avoids unnecessary charges.
  • Automatic per-domain throttling at scale without manual configuration.

References

Activity

  1. added
    t-toolingIssues with this label are in the ownership of the tooling team.
    on Sep 5, 2025
  2. janbuchar commented on Dec 4, 2025

    @janbuchar
    Collaborator

    This is tricky due to the nature of the Apify request queue which we need to support. It is not possible to set a "don't process this before " attribute there, so you cannot check the URL of a freshly dequeued request and re-insert it at the start of the queue with this set up. Also, you cannot consume requests from the queue selectively by domain.

    An approach that I already suggested for the JS version is to make a separate non-default unnamed queue for each domain where we want to allow a delay. Then we can implement the "cooldown period" on the request queue client so that it only yields a request once every N seconds. Finally, we'll wrap these request queue clients with one that will check all of them for requests ready for processing and redirect new requests to appropriate queues.

  3. vdusek commented on Feb 17, 2026

    @vdusek
    CollaboratorAuthor

    Moving to the icebox for now, as the Cloudflare Pay Per Crawl is still in private beta, let's see how it evolves.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request.t-toolingIssues with this label are in the ownership of the tooling team.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions