Here is a simple example using a live API (https://randomuser.me/)... It returns an array of objects like in your example:

import React from 'react';

class App extends React.Component {
  state = { people: [], isLoading: true, error: null };

  async componentDidMount() {
    try {
      const response = await fetch('https://randomuser.me/api/');
      const data = await response.json();
      this.setState({ people: data.results, isLoading: false });

    } catch (error) {
      this.setState({ error: error.message, isLoading: false });
    }
  }

  renderPerson = () => {
    const { people, isLoading, error } = this.state;

    if (error) {
      return <div>{error}</div>;
    }

    if (isLoading) {
      return <div>Loading...</div>;
    }

    return people.map(person => (
      <div key={person.id.value}>
        <img src={person.picture.medium} alt="avatar" />
        <p>First Name: {person.name.first}</p>
        <p> Last Name: {person.name.last}</p>
      </div>
    ));
  };

  render() {
    return <div>{this.renderPerson()}</div>;
  }
}

export default App;

Does it make sense? Should be pretty straight forward...

Live Demo Here: https://jsfiddle.net/o2gwap6b/

Answer from SakoBu on Stack Overflow
🌐
React
react.dev › reference › react › apis
Built-in React APIs – React
This page lists all the remaining modern React APIs.
🌐
React
legacy.reactjs.org › docs › react-api.html
React Top-Level API – React
React is the entry point to the React library. If you load React from a <script> tag, these top-level APIs are available on the React global.
Discussions

json - Making an API call in React - Stack Overflow
I am trying to make an API call in React to return JSON data but I am a bit confused on how to go about this. More on stackoverflow.com
🌐 stackoverflow.com
How to create a React app that connects to an API
...you just send a request to an API endpoint. More on reddit.com
🌐 r/reactjs
14
0
February 6, 2022
reactjs - How can I implement a RESTful API for a React app? - Stack Overflow
I'm new to both React and microservices. I'm building a UI application using React, it will connect to a database in the future but the app itself is just the frontend of the system. To deploy it o... More on stackoverflow.com
🌐 stackoverflow.com
So organisieren Sie die API-Schicht in Ihren React-Anwendungen mit React Query

Ich organisiere es normalerweise wie du. Ich würde empfehlen, eine weitere Schicht zwischen React Query Hooks/Types und deinen zu erstellen. Auf diese Weise verwendest du die React Query API nicht direkt, und wenn du Bibliotheken austauschen möchtest oder es Breaking Changes gibt, kannst du dies von deiner eigenen Abstraktion der Bibliothek aus handhaben.

More on reddit.com
🌐 r/Frontend
1
3
October 23, 2022
🌐
Built In
builtin.com › software-engineering-perspectives › react-api
How to Make an API Call in React: 3 Ways | Built In
An API call in React refers to making a request to a web API from a React application. We can make an API call with: XMLHttpRequest, Fetch API or Axios.
🌐
freeCodeCamp
freecodecamp.org › news › how-to-consume-rest-apis-in-react
How to Consume REST APIs in React – a Beginner's Guide
November 7, 2024 - You can consume REST APIs in a React application in a variety of ways, but in this guide, we will look at two of the most popular approaches: Axios (a promise-based HTTP client) and Fetch API (a browser in-built web API).
🌐
DEV Community
dev.to › shubhamtiwari909 › mastering-api-handling-in-javascript-react-a-complete-guide-45kk
API Handling in JavaScript & React: From Basics to Pro-Level - DEV Community
March 25, 2025 - API handling refers to making HTTP requests to a server to fetch or send data. In JavaScript and React, API calls are commonly handled using fetch, Axios, or libraries like React Query or TanStack Query.
Top answer
1 of 3
4

Here is a simple example using a live API (https://randomuser.me/)... It returns an array of objects like in your example:

import React from 'react';

class App extends React.Component {
  state = { people: [], isLoading: true, error: null };

  async componentDidMount() {
    try {
      const response = await fetch('https://randomuser.me/api/');
      const data = await response.json();
      this.setState({ people: data.results, isLoading: false });

    } catch (error) {
      this.setState({ error: error.message, isLoading: false });
    }
  }

  renderPerson = () => {
    const { people, isLoading, error } = this.state;

    if (error) {
      return <div>{error}</div>;
    }

    if (isLoading) {
      return <div>Loading...</div>;
    }

    return people.map(person => (
      <div key={person.id.value}>
        <img src={person.picture.medium} alt="avatar" />
        <p>First Name: {person.name.first}</p>
        <p> Last Name: {person.name.last}</p>
      </div>
    ));
  };

  render() {
    return <div>{this.renderPerson()}</div>;
  }
}

export default App;

Does it make sense? Should be pretty straight forward...

Live Demo Here: https://jsfiddle.net/o2gwap6b/

2 of 3
3

You will want to do something like this:

var url = 'https://myAPI.example.com/myData';
fetch(url).then((response) => response.json())
          .then(function(data) { /* do stuff with your JSON data */})
          .catch((error) => console.log(error));

Mozilla has extremely good documentation on using fetch here that I highly recommend you read.

The data parameter in the second .then will be an object parsed from the JSON response you got and you can access properties on it by just using the property label as was in the JSON. For example data.title would be "Request from Nancy".

🌐
Reddit
reddit.com › r/reactjs › how to create a react app that connects to an api
r/reactjs on Reddit: How to create a React app that connects to an API
February 6, 2022 -

I'm new to React and am trying to figure out the process of connecting a React app to an API. What are the steps? Is there a tutorial somewhere?

What code would I need if I wanted to create a simple React app and connect it to an API?

Find elsewhere
🌐
RapidAPI
rapidapi.com › blog › how-to-use-an-api-with-react
How To Use an API with ReactJS
Rapid Blog, developers #1 source for API tutorials, industry news, and more. One API key. One dashboard.
🌐
Semaphore
semaphore.io › home › why you need an api layer and how to build it in react
Why You Need an API Layer and How To Build It in React - Semaphore
August 17, 2022 - In this article, you learned what ... it in React. An API layer is a portion of your architecture that exposes everything your application needs to send and receive data via API calls....
🌐
Medium
medium.com › @wolfflucas › the-definitive-guide-to-make-api-calls-in-react-4c4da98f4d1c
The Definitive Guide to Make API Calls in React | by Lucas Wolff | Medium
June 20, 2023 - When working with vanilla JavaScript, you’ll probably be using a library like Fetch or Axios to make API requests. In React you can also use them, and the challenge is how to organize the code around these libraries to make it as readable, extensible and decoupled as possible.
🌐
DEV Community
dev.to › jeeny › how-to-create-an-api-layer-with-react-hooks-and-typescriptand-why-3a8o
How to create an API layer with React Hooks and TypeScript…and why - DEV Community
April 3, 2023 - On the front end an API layer encapsulates all the logic necessary to call, receive, and transmit data to and from your back end. An example is probably the best place to start, so let’s take a look at some code from my company Jeeny. export const SuppliersTableView: React.FC = () => { const { getSuppliers: { query, data, loading } } = useSupplierApi() useEffect(() => { query() }, [query]) const suppliers = data.items; return loading ?
🌐
GeeksforGeeks
geeksforgeeks.org › reactjs › how-to-fetch-data-from-an-api-in-reactjs
How to Fetch Data From an API in ReactJS? - GeeksforGeeks
This React component fetches data from an API using the fetch method inside componentDidMount().
Published   August 5, 2025
🌐
freeCodeCamp
freecodecamp.org › news › how-work-with-restful-apis-in-react-simplified-steps-and-practical-examples
How to Work with RESTful APIs in React
January 9, 2024 - To send data to the API, integrate the form submission logic with your HTTP request code. Use the appropriate HTTP method (for example, POST) to create new data. Implementing form validation is crucial for ensuring data integrity. You can use conditional rendering to display error messages based on validation rules. import React, { useState } from 'react'; const FormValidation = () => { const [username, setUsername] = useState(''); const [password, setPassword] = useState(''); const [error, setError] = useState(''); const handleSubmit = (e) => { e.preventDefault(); if (!username || !password)
🌐
React Native
reactnative.dev › docs › components-and-apis
Core Components and APIs · React Native
1 month ago - React Native provides a number of built-in Core Components ready for you to use in your app. You can find them all in the left sidebar (or menu above, if you are on a narrow screen). If you're not sure where to get started, take a look at the following categories: ... You're not limited to the components and APIs bundled with React Native.
🌐
React
react.dev › reference › react
React Reference Overview – React
Hooks - Use different React features from your components. Components - Built-in components that you can use in your JSX. APIs - APIs that are useful for defining components.
🌐
React
react.dev
React
On the server, React lets you start streaming HTML while you’re still fetching data, progressively filling in the remaining content before any JavaScript code loads. On the client, React can use standard web APIs to keep your UI responsive even in the middle of rendering.
🌐
React
react.dev › reference › react-dom
React DOM APIs – React
react-dom/client contains APIs to render React components on the client (in the browser).
🌐
React Flow
reactflow.dev › api-reference
API Reference - React Flow
February 19, 2026 - This reference attempts to document every function, hook, component, and type exported by React Flow. If you are looking for guides and tutorials, please refer to our learn section. We think that documentation should answer two broad questions: “what is this thing?” and “how do I use it?” · To that end, our API reference aims to concisely answer that first question and learn section goes into more detail on the second.
🌐
React
legacy.reactjs.org › docs › faq-ajax.html
AJAX and APIs – React
class MyComponent extends React.Component { constructor(props) { super(props); this.state = { error: null, isLoaded: false, items: [] }; } componentDidMount() { fetch("https://api.example.com/items") .then(res => res.json()) .then( (result) => { this.setState({ isLoaded: true, items: result.items }); }, // Note: it's important to handle errors here // instead of a catch() block so that we don't swallow // exceptions from actual bugs in components.