All courses/Digital

Course 113 · Digital course 20

Connect to APIs and Read JSON

Use a local HTTP-response simulator to practice reading structured data and handling realistic failures.

Before you start

Know JavaScript functions, arrays and basic HTML; complete Add JavaScript Interactivity first or bring equivalent experience.

See everything you’ll need

Practice materials and a worked example · Free download. Download the starter pack

What you’ll leave with

A tested local API-response viewer with a request contract, validation rules, six response cases and an honest integration handoff.

Start course Start without an account. Sign in to save lesson progress across devices.

Your project

Start with the practice files. Build your project one lesson at a time.

Practice files are free without an account. Sign in to save your project record in My Proof: a description, checklist, and optional work link. Keep the original files in your own app or notebook; saving a project record does not upload them.

  1. Get your materialsDownload practice filesStart with the supplied materials, follow the lessons, and compare your work with the annotated example.
  2. Make your projectView the project checklist Work in your own notebook, document, or software. Use the supplied practice examples when you prefer.
  3. Keep a private recordSave a project record Sign in to save a description and checklist, then return to update them.
Optional course overview

Watch an introduction.

This overview from freeCodeCamp.org introduces ideas you’ll practice in the lessons.

Watch directly on YouTube
freeCodeCamp.orgAPIs for Beginners - How to use an API (Full Course / Tutorial)YouTube
Course handbook

Know the route before you begin.

Here’s what you’ll need and what you’ll make. You can return to this guide during any lesson.

Who this is for

Learners age 14+ who meet the stated prerequisites.

Prepare before lesson one
  • Know JavaScript functions, arrays and basic HTML; complete Add JavaScript Interactivity first or bring equivalent experience.
  • Use a modern browser and free text editor. No key, account or server is required.
  • Reading and core practice include the three checks. Initial software setup and optional video viewing take extra time.
Your final project

Finish with proof you can use.

A tested local API-response viewer with a request contract, validation rules, six response cases and an honest integration handoff.

Save a project record in My Proof
See project checklist and review criteria

Keep your working files in your own notebook or software. Save a private description, checklist, and work link in My Proof.

What to include

  • Request/response contract with limits.
  • Type and status observations.
  • Working local viewer.
  • Explicit empty/error/validation behavior.
  • Six-case test matrix and README.

Review and revise

Use these criteria to check your work and choose what to improve.

  • Fields and types are understood.
  • Failures do not show stale results.
  • All six cases behave as described.
  • Simulation and live-integration limits are explicit.
Three ideas to help you along the way
Three useful ideas

The rules behind the steps.

01

Read the contract

Check method, path, shape and meaning before using data.

02

Expect failure

Loading, emptiness and errors deserve explicit states.

03

Keep claims honest

Mock tests establish local logic, not production service behavior.

What do these words mean?
Key words

Key terms worth knowing.

API
A defined interface through which programs request capabilities or data.
JSON
A text format for structured values.
HTTP status
A numeric response classification.
Promise
A JavaScript object representing a future result.
Schema
Rules for required fields, types and relationships.
Your route

6 lessons.
One useful project.

Work in order the first time. Each lesson makes something the next lesson can use.

  1. 1
    Up next

    Read a request and response contract

    Identify the method, path and expected response fields.

  2. 2
    31 min

    Parse structured values without guessing types

    Distinguish JSON strings, numbers, arrays and missing fields.

  3. 3
    31 min

    Make a read-only request and inspect status

    Use an asynchronous response and explain simulation versus live transport.

  4. 4
    31 min

    Handle failed responses without stale results

    Show useful states for HTTP and parsing errors.

  5. 5
    31 min

    Validate records before rendering

    Reject invalid records and insert response text safely.

  6. 6
    31 min

    Test a complete response matrix

    Demonstrate accepted, empty, malformed and error cases in a repeatable handoff.

Use the tools

Tools to help you practice.

See all tools
Source transparency

Sources and further study.

Explore the references behind the lessons and take your learning further. Source notes explain access and reuse.

MDN: Working with JSON
Source & access notes · checked 2026-09-12

Opened and inspected on 2026-09-12: JSON types and parsing.

Access: Free public web page; no paid enrollment required.

Reuse: Public reference; link only. LifeStarter prose, exercises and files are independently authored.

MDN: Using the Fetch API
Source & access notes · checked 2026-09-12

Opened and inspected on 2026-09-12: Responses, promises and explicit HTTP status checks.

Access: Free public web page; no paid enrollment required.

Reuse: Public reference; link only. LifeStarter prose, exercises and files are independently authored.

MDN: HTTP response status codes
Source & access notes · checked 2026-09-12

Opened and inspected on 2026-09-12: 200, 404 and server-error categories.

Access: Free public web page; no paid enrollment required.

Reuse: Public reference; link only. LifeStarter prose, exercises and files are independently authored.

APIs for Beginners - How to use an API (Full Course / Tutorial)
Source & access notes · checked 2026-09-12

Metadata retrieved and inspected on 2026-09-12: exact title and channel confirmed through YouTube oEmbed. Playback and full video content were not tested. Optional overview; the written lesson and supplied practice stand alone.

Access: Free public web page; no paid enrollment required.

Reuse: Link or provider embed only; do not copy video, audio or transcript.

Ready when you are

Start with the first useful move.

You’ll always know what to do, what to make, and where to go next.

Start lesson one