example-data.com
Menu
Browse docs and collections

Overview

authors / #10

Leo Tolstoy

Leo Tolstoy

Tres laboriosam patior culpo thermae. Aperte causa vox tumultus agnitio careo desipio somniculosus ultio amplexus. Assentator tamquam aestus tabesco crudelis advenio.

Component variants

Request

curl example

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

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/authors/10"
);
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/10"
);
const author = (await res.json()) as Author;

Python example

import requests

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

Response

{
  "id": 10,
  "name": "Leo Tolstoy",
  "slug": "leo-tolstoy",
  "bio": "Tres laboriosam patior culpo thermae. Aperte causa vox tumultus agnitio careo desipio somniculosus ultio amplexus. Assentator tamquam aestus tabesco crudelis advenio.",
  "bornYear": 1828,
  "diedYear": 1910,
  "nationality": "Russian",
  "genres": [
    "Realism",
    "Literary fiction"
  ],
  "notableWorks": [
    "War and Peace",
    "Anna Karenina"
  ],
  "imageUrl": "https://picsum.photos/seed/author-10/600/600",
  "createdAt": "2024-06-18T09:09:46.413Z"
}