example-data.com
Menu
Browse docs and collections

attachments

attachments

Page 3 of 34.

Overview

Request

curl example

curl -sS \
  "https://example-data.com/api/v1/attachments?limit=25"

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/attachments?limit=25"
);
const { data, meta } = await res.json();

TypeScript example

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

const res = await fetch(
  "https://example-data.com/api/v1/attachments?limit=25"
);
const { data, meta } = (await res.json()) as ListEnvelope<Attachment>;

Python example

import requests

res = requests.get(
    "https://example-data.com/api/v1/attachments",
    params={"limit": 25},
)
data = res.json()

Response

{
  "data": [
    {
      "id": 49,
      "userId": 84,
      "targetType": "recipe",
      "targetId": 118,
      "url": "https://picsum.photos/seed/attachment-49/800/800",
      "mimeType": "image/webp",
      "sizeBytes": 44726190,
      "createdAt": "2025-12-13T10:58:08.515Z"
    },
    {
      "id": 50,
      "userId": 79,
      "targetType": "comment",
      "targetId": 196,
      "url": "https://picsum.photos/seed/attachment-50/1200/600",
      "mimeType": "image/png",
      "sizeBytes": 35133515,
      "createdAt": "2025-09-06T15:10:36.173Z"
    },
    {
      "id": 51,
      "userId": 90,
      "targetType": "recipe",
      "targetId": 239,
      "url": "https://picsum.photos/seed/attachment-51/800/600",
      "mimeType": "image/jpeg",
      "sizeBytes": 21420166,
      "createdAt": "2025-09-12T09:09:12.935Z"
    }
  ],
  "meta": {
    "page": 3,
    "limit": 24,
    "total": 800,
    "totalPages": 34
  },
  "links": {
    "self": "/api/v1/attachments?page=3&limit=24",
    "first": "/api/v1/attachments?page=1&limit=24",
    "last": "/api/v1/attachments?page=34&limit=24",
    "next": "/api/v1/attachments?page=4&limit=24",
    "prev": "/api/v1/attachments?page=2&limit=24"
  }
}