Skip to main content
100%

Requesting data from the Github API

✓ Published1🌍 Public
LLaurens
Last edited Feb 4, 2020
Created on Feb 4, 2020

This example demonstrates a simple user-driven data request to the Wikipedia API. It shows how a text input and submit button trigger a `fetch` call to the opensearch endpoint, retrieving and displaying search results based on the submitted subject. The code uses the browser’s built-in `fetch` API to request JSON data, then logs the response and result titles to the console via chained `.then()` promises. The interface includes a loader placeholder and a result article, though the visible rendering of the results is minimal, focusing on the request-response flow.

AI-generated description

Requesting data from the Wikipedia API

Concept

An example showing how to go from an API request using fetch

MIT Licensed

Similar vizzes