Golang REST API Tutorial | Simple Example Using the YouTube API

Опубликовано: 13 Февраль 2026
на канале: Learn Fast Make Things
5,013
100

In this Golang REST API Tutorial, we're going to be looking at how to create a simple example using the YouTube API. This tutorial will cover how to go from a basic Golang web server to a JSON REST API in just a few minutes!

REST APIs in Golang are really useful if you want to create a single-page app frontend that gets its data from a custom API that you create. They are fast and easy to build so there are no headaches.

This video is part two of a series starting from scratch and building a fully deployable Kubernetes service written in Golang. See the first video where you can learn to create the web server in Golang:    • Build a Golang REST API with Kubernetes He...  

References from the video
Askcloudarchitech website: https://askcloudarchitech.com
Youtube API docs: https://developers.google.com/youtube...
Github repo for this project: https://github.com/askcloudarchitech/...
golang HTTP docs: https://pkg.go.dev/net/http#pkg-const...


00:00 - Create A REST API Golang
00:10 - Set up file structure
00:33 - Create handler function
00:55 - Create type for response body
01:47 - Create temporary fake data response
02:10 - Create JSON response
03:19 - Run with sample data
03:49 - Fixing capital letters in JSON response keys
04:28 - Accessing the youtube API
05:18 - Creating a Youtube API key
06:05 - Implementing the Youtubev3 package
06:50 - Creating the API call
07:23 - FAILURES!!! - lessons to learn
08:50 - Add channel ID to API call
09:47 - Map API values to JSON response
10:52 - Does it work?
10:56 - Make channel ID configurable
11:51 - Final Important Steps