example-data.com
Menu
Browse docs and collections

goals

goals

Page 10 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": 217,
      "userId": 217,
      "name": "Bench press bodyweight",
      "category": "fitness",
      "targetValue": 77.4,
      "currentValue": 6.1,
      "unit": "kg",
      "deadline": "2026-11-13",
      "isCompleted": false,
      "createdAt": "2025-06-19T17:00:43.138Z"
    },
    {
      "id": 218,
      "userId": 217,
      "name": "Run a 5K",
      "category": "fitness",
      "targetValue": 5,
      "currentValue": 0,
      "unit": "km",
      "deadline": "2026-07-16",
      "isCompleted": false,
      "createdAt": "2025-08-31T08:38:05.594Z"
    },
    {
      "id": 219,
      "userId": 219,
      "name": "Bench press bodyweight",
      "category": "fitness",
      "targetValue": 66.4,
      "currentValue": 32.4,
      "unit": "kg",
      "deadline": null,
      "isCompleted": false,
      "createdAt": "2025-09-05T13:48:00.278Z"
    }
  ],
  "meta": {
    "page": 10,
    "limit": 24,
    "total": 244,
    "totalPages": 11
  },
  "links": {
    "self": "/api/v1/goals?page=10&limit=24",
    "first": "/api/v1/goals?page=1&limit=24",
    "last": "/api/v1/goals?page=11&limit=24",
    "next": "/api/v1/goals?page=11&limit=24",
    "prev": "/api/v1/goals?page=9&limit=24"
  }
}