<?xml version="1.0" encoding="UTF-8"?>
<response><data><post><id>169</id><slug>rate-limit-headers-explained-part-9-169</slug><title>Rate limit headers explained, part 9</title><excerpt>Part 9 looks at what changes when the same technique has to run every day in production. A well-behaved API tells you how many requests you have left before it starts saying no. Reading those headers…</excerpt><seriesName>Rate limit headers explained</seriesName><seriesPart>9</seriesPart><sections><item><heading>Introduction</heading><paragraphs><item>Part 9 looks at what changes when the same technique has to run every day in production. A well-behaved API tells you how many requests you have left before it starts saying no. Reading those headers turns rate limiting from a surprise into a plan.</item></paragraphs></item><item><heading>Common pitfalls</heading><paragraphs><item>Write small, focused tests for your parsers using saved HTML fixtures. They run in milliseconds and catch layout changes long before a full crawl would.</item><item>Read the site's terms of service before you start. Many sites welcome automated access within limits and say so explicitly; others ask you to use an API instead.</item><item>Treat HTTP 429 responses as a signal, not an obstacle. Read the Retry-After header, back off, and resume at a slower pace.</item></paragraphs></item><item><heading>What to watch for</heading><paragraphs><item>Keep configuration such as base URLs, delays and selectors out of your code. Changing a delay should not require a redeploy.</item><item>Pagination comes in several shapes: numbered pages, next links, offsets and opaque cursors. Each has trade-offs, and a robust scraper should detect the end of the result set rather than assuming a fixed number of pages.</item></paragraphs></item><item><heading>Key takeaway</heading><paragraphs><item>Track X-RateLimit-Remaining, slow down as it approaches zero, and when you receive a 429, wait for the number of seconds in Retry-After before trying again.</item></paragraphs></item></sections><authorId>5</authorId><authorName>Chen Patel</authorName><authorSlug>chen-patel</authorSlug><category>APIs</category><tags><item>python</item><item>testing</item></tags><publishedAt>2025-10-03T00:00:00.000Z</publishedAt><wordCount>202</wordCount><readingTimeMinutes>2</readingTimeMinutes></post></data></response>
