React Native · Flutter · Swift · Kotlin

Mock API for Mobile Apps

Build and prototype your mobile app with a live REST API that serves realistic fake data. No backend server, no localhost problems on physical devices — just a public HTTPS endpoint your iOS, Android, React Native, or Flutter app can call immediately.

Mobile prototyping without a backend is hard

Localhost doesn't work

Physical devices and emulators with host networking can't reach http://localhost. You need a real public URL to test network calls.

Hardcoded data is fragile

Hardcoded mock arrays in your app make it impossible to test pagination, infinite scroll, pull-to-refresh, and real-world list sizes.

Backend delays block shipping

Mobile sprints stall when the API team is behind. You end up building placeholder screens that never get replaced before launch.

Works with every mobile HTTP client

Your Rest Faker endpoint is a standard REST API — call it from any platform.

React Native (fetch)

import { useEffect, useState } from "react";
import { FlatList, Text, View } from "react-native";

const BASE = "https://api.restfaker.dev/api/schema";
const TOKEN = "YOUR_API_TOKEN";

export function ProductList() {
  const [products, setProducts] = useState([]);

  useEffect(() => {
    fetch(`${BASE}/products?perPage=20`, {
      headers: { apiToken: TOKEN },
    })
      .then(r => r.json())
      .then(({ data }) => setProducts(data));
  }, []);

  return (
    <FlatList
      data={products}
      keyExtractor={(item) => item.id}
      renderItem={({ item }) => (
        <View>
          <Text>{item.name}</Text>
          <Text>{item.price{"}"}</Text>
        </View>
      )}
    />
  );
}

Flutter (http package)

import 'package:http/http.dart' as http;
import 'dart:convert';

const base = 'https://api.restfaker.dev/api/schema';
const token = 'YOUR_API_TOKEN';

Future<List<dynamic>> fetchProducts() async {
  final response = await http.get(
    Uri.parse('$base/products?perPage=20'),
    headers: { 'apiToken': token },
  );

  if (response.statusCode == 200) {
    final body = jsonDecode(response.body);
    return body['data'] as List<dynamic>;
  }

  throw Exception('Failed to load products');
}

Swift (URLSession)

import Foundation

struct Product: Codable {
  let id: String
  let name: String
  let price: Double
}

struct ProductsResponse: Codable {
  let data: [Product]
}

var request = URLRequest(
  url: URL(string:
    "https://api.restfaker.dev/api/schema/products"
  )!
)
request.setValue("YOUR_API_TOKEN", forHTTPHeaderField: "apiToken")

URLSession.shared.dataTask(with: request) { data, _, _ in
  if let data,
     let resp = try? JSONDecoder().decode(
       ProductsResponse.self, from: data
     ) {
    print(resp.data)
  }
}.resume()

Kotlin (Retrofit + Moshi)

data class Product(
  val id: String,
  val name: String,
  val price: Double
)

data class ProductsResponse(val data: List<Product>)

interface MockApi {
  @GET("products")
  suspend fun getProducts(
    @Header("apiToken") token: String,
    @Query("perPage") perPage: Int = 20
  ): ProductsResponse
}

val api = Retrofit.Builder()
  .baseUrl("https://api.restfaker.dev/api/schema/")
  .addConverterFactory(MoshiConverterFactory.create())
  .build()
  .create(MockApi::class.java)

// Call:
// api.getProducts(token = "YOUR_API_TOKEN")

Designed for real mobile development workflows

Public HTTPS Endpoint

Every mock API runs over HTTPS with a valid certificate — works on real devices and simulators.

No Localhost Issues

Physical devices can't reach localhost. Rest Faker endpoints are always publicly accessible.

Mock Auth Flows

Test login screens and protected routes with built-in mock token endpoints.

Offline-Ready Testing

Define your API shape upfront so you can build and test even before the real backend exists.

Realistic Data

Real names, email addresses, prices, and dates — your list views and detail screens look production-ready.

Scenario Engine

Simulate network errors and timeouts to test your app's offline and error handling states.

Why mobile teams choose Rest Faker

Public HTTPS endpoint — works on physical devices and simulators without port forwarding

Realistic data — list views, cards, and detail screens look production-ready immediately

Pagination works — test infinite scroll and load-more with ?page= and ?perPage=

Mutations persist — POST and PATCH update stored data so flows feel real

Scenario engine — trigger 500 errors and timeouts to harden your error states

Free to start — no backend setup, no credit card, no infrastructure to manage

Start prototyping your mobile app today

Live HTTPS endpoint, realistic data, full CRUD. Free — no credit card required.