JSON API Samples - Dummy Data for Testing

Explore JSON API samples with dummy data for testing and learn how to use fetch API

Test various API endpoints with different JSON structures including user data, products, weather, financial data, and e-commerce orders.

User Data API

Simple user profile with nested objects and arrays

GEThttps://www.json-tools.com/api/test/test1

Product Catalog API

E-commerce product data with arrays and filtering

GEThttps://www.json-tools.com/api/test/test2

Weather Data API

Complex weather data with nested objects and arrays

GEThttps://www.json-tools.com/api/test/test3

Financial Portfolio API

Financial data with complex nested structures

GEThttps://www.json-tools.com/api/test/test4

E-commerce Order API

Complex order data with nested arrays and objects

GEThttps://www.json-tools.com/api/test/test5

How to Use Fetch API

Learn how to fetch data from these APIs using JavaScript

Using Promises (.then/.catch)

// Fetch data from User Data API
fetch('https://www.json-tools.com/api/test/test1')
  .then(response => {
    if (!response.ok) {
      throw new Error('Network response was not ok');
    }
    return response.json();
  })
  .then(data => {
    console.log('API Response:', data);
    // Handle the data here
  })
  .catch(error => {
    console.error('Error fetching data:', error);
  });

Using Async/Await

// Fetch data using async/await from User Data API
async function fetchData() {
  try {
    const response = await fetch('https://www.json-tools.com/api/test/test1');
    
    if (!response.ok) {
      throw new Error('Network response was not ok');
    }
    
    const data = await response.json();
    console.log('API Response:', data);
    return data;
  } catch (error) {
    console.error('Error fetching data:', error);
    throw error;
  }
}

// Call the function
fetchData();

💡 Pro Tips

  • • Always check response.ok before parsing JSON
  • • Use try/catch blocks for error handling
  • • Consider adding loading states and error boundaries in your UI
  • • For production apps, add request timeouts and retry logic
  • • Use TypeScript for better type safety with API responses
You can use both Promise-based (.then/.catch) and async/await syntax to fetch data. The tool provides code examples for both approaches, including proper error handling and response checking.
The tool provides 5 different API endpoints: User Data (simple objects), Product Catalog (arrays and filtering), Weather Data (complex nested objects), Financial Portfolio (financial data structures), and E-commerce Orders (complex nested arrays and objects).
Yes, you can fetch live data from the actual API endpoints or load sample data to see the expected JSON structure. The tool provides both options for testing and learning.
This tool teaches fetch API usage, JSON structure patterns, error handling, async/await syntax, Promise handling, and different data modeling approaches used in real-world applications.
These are sample APIs created specifically for learning purposes. They return realistic data structures but are not connected to real services. Perfect for safe testing and learning.