example-data.com
Menu
Browse docs and collections

Overview

authors / #1

William Shakespeare

William Shakespeare

Vilitas thesis caute soleo aliquid aliqua delectatio conventus. Amplus colligo circumvenio voluptas curo consectetur demonstro animus repudiandae. Defleo ater verumtamen credo.

Component variants

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 1,
  "name": "William Shakespeare",
  "slug": "william-shakespeare",
  "bio": "Vilitas thesis caute soleo aliquid aliqua delectatio conventus. Amplus colligo circumvenio voluptas curo consectetur demonstro animus repudiandae. Defleo ater verumtamen credo.",
  "bornYear": 1564,
  "diedYear": 1616,
  "nationality": "English",
  "genres": [
    "Drama",
    "Poetry",
    "Tragedy"
  ],
  "notableWorks": [
    "Hamlet",
    "Macbeth",
    "Romeo and Juliet"
  ],
  "imageUrl": "https://picsum.photos/seed/author-1/600/600",
  "createdAt": "2024-09-02T12:28:04.676Z"
}