Skip to content
Python and Data Primer / Financial Data Access

APIs

An API lets a program request data from a service. The response can arrive successfully and still contain the wrong currency, a stale quote or an invalid price. This lesson decodes an offline JSON fixture and checks the fields needed by the calculation. It extends file parsing and exceptions to a service response; time-series checks address timestamps after parsing.
Learning objectives. By the end of this note you should be able to distinguish URL parameters from response data, interpret common status classes, decode JSON and validate required fields.

In this lesson

  1. Request, response, validation
  2. Credentials and rate limits
  3. Protocol and data checks protect different steps

Before you start

The full lesson, with worked examples and exercise solutions, is for members.

Read the full lesson

New to SelfMadeQuant.com? See membership options or browse the Python and Data Primer syllabus.