Join our community

Get access to the complete guide to developing and deploying fast, production-ready Nuxt apps.

Fetch Data From Your API with $fetch

In this lesson, you’ll learn how to do basic data fetching with $fetch from ofetch. You’ll fetch the mocked AI response from the server route you created in the previous lesson.

In future lessons we’ll see how we can use useFetch and useAsyncData to give us some extra benefits that $fetch doesn’t do for us.

$fetch: https://nuxt.com/docs/api/utils/dollarfetch

ofetch ($fetch): https://github.com/unjs/ofetch