example-data.com
Menu
Browse docs and collections

goals

goals

Page 8 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": 169,
      "userId": 172,
      "name": "Drink 2L water daily",
      "category": "nutrition",
      "targetValue": 2.6,
      "currentValue": 1.5,
      "unit": "L/day",
      "deadline": null,
      "isCompleted": false,
      "createdAt": "2025-07-20T21:00:50.490Z"
    },
    {
      "id": 170,
      "userId": 172,
      "name": "Reduce body fat",
      "category": "weight",
      "targetValue": 14.1,
      "currentValue": 9.4,
      "unit": "%",
      "deadline": "2026-08-01",
      "isCompleted": false,
      "createdAt": "2025-10-20T22:22:57.257Z"
    },
    {
      "id": 171,
      "userId": 173,
      "name": "Lose weight",
      "category": "weight",
      "targetValue": 64.8,
      "currentValue": 53.9,
      "unit": "kg",
      "deadline": "2027-04-03",
      "isCompleted": false,
      "createdAt": "2026-04-14T01:36:34.487Z"
    }
  ],
  "meta": {
    "page": 8,
    "limit": 24,
    "total": 244,
    "totalPages": 11
  },
  "links": {
    "self": "/api/v1/goals?page=8&limit=24",
    "first": "/api/v1/goals?page=1&limit=24",
    "last": "/api/v1/goals?page=11&limit=24",
    "next": "/api/v1/goals?page=9&limit=24",
    "prev": "/api/v1/goals?page=7&limit=24"
  }
}