example-data.com
Menu
Browse docs and collections

goals

goals

Page 5 of 11.

Overview

Request

curl example

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

JavaScript example

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

TypeScript example

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

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

Python example

import requests

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

Response

{
  "data": [
    {
      "id": 97,
      "userId": 98,
      "name": "Reduce body fat",
      "category": "weight",
      "targetValue": 15.3,
      "currentValue": 11.1,
      "unit": "%",
      "deadline": "2026-11-23",
      "isCompleted": false,
      "createdAt": "2026-03-23T20:33:05.357Z"
    },
    {
      "id": 98,
      "userId": 100,
      "name": "Work out 4x per week",
      "category": "habit",
      "targetValue": 4.5,
      "currentValue": 4.5,
      "unit": "sessions/week",
      "deadline": "2026-08-02",
      "isCompleted": true,
      "createdAt": "2026-01-25T10:09:01.345Z"
    },
    {
      "id": 99,
      "userId": 102,
      "name": "Run a 5K",
      "category": "fitness",
      "targetValue": 5,
      "currentValue": 5,
      "unit": "km",
      "deadline": "2026-12-06",
      "isCompleted": true,
      "createdAt": "2025-06-25T08:50:47.159Z"
    }
  ],
  "meta": {
    "page": 5,
    "limit": 24,
    "total": 244,
    "totalPages": 11
  },
  "links": {
    "self": "/api/v1/goals?page=5&limit=24",
    "first": "/api/v1/goals?page=1&limit=24",
    "last": "/api/v1/goals?page=11&limit=24",
    "next": "/api/v1/goals?page=6&limit=24",
    "prev": "/api/v1/goals?page=4&limit=24"
  }
}