example-data.com
Menu
Browse docs and collections

Overview

authors / #12

Mark Twain

Mark Twain

Bis quasi sperno supplanto. Comedo atque denego caput barba sufficio. Cribro exercitationem laborum capitulus abstergo tabula.

Component variants

Request

curl example

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

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/authors/12"
);
const author = await res.json();

TypeScript example

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

const res = await fetch(
  "https://example-data.com/api/v1/authors/12"
);
const author = (await res.json()) as Author;

Python example

import requests

res = requests.get(
    "https://example-data.com/api/v1/authors/12"
)
author = res.json()

Response

{
  "id": 12,
  "name": "Mark Twain",
  "slug": "mark-twain",
  "bio": "Bis quasi sperno supplanto. Comedo atque denego caput barba sufficio. Cribro exercitationem laborum capitulus abstergo tabula.",
  "bornYear": 1835,
  "diedYear": 1910,
  "nationality": "American",
  "genres": [
    "Humor",
    "Adventure"
  ],
  "notableWorks": [
    "The Adventures of Huckleberry Finn",
    "The Adventures of Tom Sawyer"
  ],
  "imageUrl": "https://picsum.photos/seed/author-12/600/600",
  "createdAt": "2025-04-05T19:48:27.422Z"
}