APIs for Data Collection

Context: FIT1043_MOC · how to reach new data sources programmatically · one of the best ways to gather data for a project

Quick Revision

  • 🎯 Objective: access an application’s data/functionality by code âž” a computer-facing interface (not a human UI).
  • ⚡ Key Constraint: the consumer↔provider split — you (consumer) request from a provider’s API, usually needing a key (sign-up/auth).

📝 Core

  • API (Application Programmer Interface) âž” routines giving programmatic access to an application or its data; like a UI but for computers.
  • Machine-to-machine âž” programs talk to each other to access data/services (e.g. Google Maps).
  • Consumer vs provider âž” the provider exposes the API; the consumer calls it.
  • REST API âž” the common web style; e.g. OpenWeather — sign up, verify email, copy an API key, then call it from Python.
  • Rich metadata âž” e.g. Twitter/X exposes users, follower networks, locations, hashtags, emojis; real-time tweet filtering via the streaming API; multi-language client libraries.
  • Widespread âž” Facebook, Twitter/X, LinkedIn, Google Maps, YouTube, Amazon Advertising, TripAdvisor.

⚠️ Common Mistakes

  • đź’ˇ An API is for computers, not people âž” it returns structured data (often JSON/XML) for code, not a rendered web page.
  • đź’ˇ Keys and policies apply âž” most providers require a key and enforce a developer policy / rate limits; you’re a consumer of their service.

đź§  Active Recall