example-data.com
Menu
Browse docs and collections

Overview

people / #21

Component variants

Request

curl example

curl -sS \
  "https://example-data.com/api/v1/people/21" \
  -H "Accept: application/json"

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/people/21"
);
const person = await res.json();

TypeScript example

// Download once: mkdir -p types && curl -o types/people.d.ts https://example-data.com/types/people.d.ts
import type { Person } from "./types/people";

const res = await fetch(
  "https://example-data.com/api/v1/people/21"
);
const person = (await res.json()) as Person;

Python example

import requests

res = requests.get(
    "https://example-data.com/api/v1/people/21"
)
people = res.json()

Response

{
  "id": 21,
  "fullName": "Candelario Brakus",
  "firstName": "Candelario",
  "lastName": "Brakus",
  "email": "candelario.brakus-21@example.com",
  "phone": "+1 202-555-0120 ext 1",
  "occupation": "International Mobility Assistant",
  "city": "Port Bridget",
  "countryAlpha2": "SG",
  "bio": "philosopher",
  "avatarUrl": "https://api.dicebear.com/9.x/avataaars/svg?seed=person-21",
  "createdAt": "2024-08-13T11:50:22.924Z"
}