Building a Lost and Found API

Build a read-only Go catalog API with complete JSON data, combined filters and clear errors, then test it and use it through a real website.

ProjectGolang

Introduction

Building a Lost and Found API is a practical Go project for learners who know the language basics and want to serve useful data over HTTP. Complete a read-only API for a community lost property catalog, then use the prepared website to search for items and open their details.

Two Guided Labs take you from a working one-item sample to complete catalog responses, reusable handlers, search and predictable errors. One independent Challenge applies the same contract to a different lost property desk. Each unit starts with its own prepared environment and data; files from a previous lab are not required. Allow about 120–160 minutes, an author estimate including reading and ordinary corrections.

What You Will Learn

After completing this course, you will be able to:

  • connect request paths and methods to Go HTTP handlers and JSON responses;
  • return every catalog record and identify individual items by ID, even when names match;
  • combine category and keyword filters so a result satisfies both conditions;
  • distinguish an empty result list from an invalid request, a missing item and an unsupported method;
  • test handlers with httptest and check status, response content and JSON shape together;
  • use a real website that reads your API, while preserving the supplied catalog and page.

Who This Course Is For

This course is for Go learners ready to combine familiar data structures and functions into a small service.

Prerequisites: Basic terminal navigation, Go structs, slices, maps, functions and modules. HTTP handling, JSON encoding, explicit error handling and handler testing are explained before use. Prior web framework or database experience is not required.

Learning environment: LabEx provides Go, starter code, catalog data and a browser-based WebIDE. Use the Workspace terminal and the Lost and Found website to build and try the service without installing Go locally. The website, interface labels, commands and program output remain in English.

Frequently Asked Questions

Will I build the website too?

The website is prepared. Your work is the Go API that supplies its actual search results and item details. You will use the page to see how a consumer depends on your responses.

Which tools will I use?

The project uses Go's standard library, including net/http, encoding/json and httptest. It does not require a framework, database, authentication system or concurrent writes.

What changes in the Challenge?

The catalog has different records, categories and IDs, including items with the same name. You apply the already practiced API contract independently. The task remains read-only; adding or deleting catalog records is outside its scope.

Teacher

labby
Labby
Labby is the LabEx teacher.