example-data.com
Menu
Browse docs and collections

attachments

attachments

Page 15 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": 337,
      "userId": 191,
      "targetType": "post",
      "targetId": 198,
      "url": "https://picsum.photos/seed/attachment-337/400/600",
      "mimeType": "image/png",
      "sizeBytes": 20044753,
      "createdAt": "2025-10-03T03:19:32.532Z"
    },
    {
      "id": 338,
      "userId": 214,
      "targetType": "restaurant",
      "targetId": 84,
      "url": "https://picsum.photos/seed/attachment-338/800/400",
      "mimeType": "image/jpeg",
      "sizeBytes": 39451480,
      "createdAt": "2026-01-04T21:53:28.450Z"
    },
    {
      "id": 339,
      "userId": 95,
      "targetType": "post",
      "targetId": 470,
      "url": "https://picsum.photos/seed/attachment-339/400/800",
      "mimeType": "image/jpeg",
      "sizeBytes": 44841818,
      "createdAt": "2025-10-01T03:51:46.047Z"
    }
  ],
  "meta": {
    "page": 15,
    "limit": 24,
    "total": 800,
    "totalPages": 34
  },
  "links": {
    "self": "/api/v1/attachments?page=15&limit=24",
    "first": "/api/v1/attachments?page=1&limit=24",
    "last": "/api/v1/attachments?page=34&limit=24",
    "next": "/api/v1/attachments?page=16&limit=24",
    "prev": "/api/v1/attachments?page=14&limit=24"
  }
}