all templates
APIs & Data

GitHub Profile Card

Type a username, get their profile — your first taste of an API.

A search box that fetches anyone's public GitHub profile and shows it as a card. The cleanest introduction to fetch(): request a URL, wait for the JSON, put the fields on the page — and handle the user who doesn't exist.

What's inside

  • Live profile lookup by username
  • fetch() → await res.json() → render, explained
  • Handles 404s and network errors gracefully
  • A loading state while the request is in flight
  • Free API, no key required

Quickstart

$ curl -LO https://devai.io/downloads/github-profile.zip$ unzip github-profile.zip && cd github-profile$ open index.html   # or just double-click the file

Browse the code

The full source, exactly as the zip ships it.

loading…
Download .zip
loading tree…

about this tutorial

A devai.io starter tutorial — the canonical first API call, done properly.