internalsGet Pro

Module 03 · Lesson 4 of 10Pro

Pulling data from APIs: pagination and rate limits

Level
Intermediate
Topic
Python for data engineering
Reading time
15 min

When you finish this page you can

  1. Explain why offset pagination skips or repeats records when the source changes during a pull, and why a cursor does not.
  2. Work out how long a paged pull takes under a rate limit, and why more threads don’t make it faster.
  3. Write a Python loop that follows a cursor, paces its requests and waits out a 429 without losing a page.
  4. Choose a load window so each night’s pull has a fixed start and end.
  1. Data sources: databases, events, files and APIs13 min
  2. DataFrames: pandas and Polars14 min

Sixty pages in twelve seconds, then a 429

At 01:00:12 on Tuesday 10 November, Meera’s new script gets its 61st answer from the payment provider. It isn’t a page of payments. It’s 429, Too Many Requests, and the script crashes.

Our biggest sale ever · Black Friday

Flat 50% Off

Pro

Continue reading

Unlock every course, now and later

  • System Design, live
  • AI Engineering, live
  • Data Engineering, live
  • Machine Learning Engineering, live
  • Inference Engineering, coming soon
  • AI Research, coming soon
  • Performance Engineering, coming soon
  • Agent & Harness Engineering, coming soon
  • LLM Fine-tuning, coming soon
  • LLM Pre-training & Post-training, coming soon
  • Reinforcement Learning, coming soon
  • AI Infrastructure & Platform Engineering, coming soon
  • AI Evaluation & Safety, coming soon
  • Forward Deployed Engineering, coming soon
  • Cloud Computing, coming soon
  • DevOps, coming soon

50% off · Annual and Lifetime

BLACKFRIDAY50Applied at checkout

Choose a plan