example-data.com
Menu
Browse docs and collections

goals

goals

Page 4 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": 73,
      "userId": 72,
      "name": "Drink 2L water daily",
      "category": "nutrition",
      "targetValue": 2.6,
      "currentValue": 1.6,
      "unit": "L/day",
      "deadline": "2026-12-10",
      "isCompleted": false,
      "createdAt": "2025-12-17T20:27:21.473Z"
    },
    {
      "id": 74,
      "userId": 73,
      "name": "Eat 150g protein daily",
      "category": "nutrition",
      "targetValue": 196.5,
      "currentValue": 168.9,
      "unit": "g/day",
      "deadline": "2026-06-09",
      "isCompleted": false,
      "createdAt": "2025-10-12T14:45:48.689Z"
    },
    {
      "id": 75,
      "userId": 75,
      "name": "Gain muscle mass",
      "category": "weight",
      "targetValue": 99,
      "currentValue": 45.5,
      "unit": "kg",
      "deadline": "2026-07-01",
      "isCompleted": false,
      "createdAt": "2026-03-04T16:26:30.515Z"
    }
  ],
  "meta": {
    "page": 4,
    "limit": 24,
    "total": 244,
    "totalPages": 11
  },
  "links": {
    "self": "/api/v1/goals?page=4&limit=24",
    "first": "/api/v1/goals?page=1&limit=24",
    "last": "/api/v1/goals?page=11&limit=24",
    "next": "/api/v1/goals?page=5&limit=24",
    "prev": "/api/v1/goals?page=3&limit=24"
  }
}