example-data.com
Menu
Browse docs and collections

goals

goals

Page 9 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": 193,
      "userId": 194,
      "name": "Bench press bodyweight",
      "category": "fitness",
      "targetValue": 102.5,
      "currentValue": 94.8,
      "unit": "kg",
      "deadline": "2027-04-26",
      "isCompleted": false,
      "createdAt": "2025-12-15T20:25:23.463Z"
    },
    {
      "id": 194,
      "userId": 195,
      "name": "Run a 5K",
      "category": "fitness",
      "targetValue": 5,
      "currentValue": 0.4,
      "unit": "km",
      "deadline": "2026-10-06",
      "isCompleted": false,
      "createdAt": "2025-09-18T04:39:30.011Z"
    },
    {
      "id": 195,
      "userId": 197,
      "name": "Bench press bodyweight",
      "category": "fitness",
      "targetValue": 79.6,
      "currentValue": 75.3,
      "unit": "kg",
      "deadline": null,
      "isCompleted": false,
      "createdAt": "2025-08-09T14:01:59.429Z"
    }
  ],
  "meta": {
    "page": 9,
    "limit": 24,
    "total": 244,
    "totalPages": 11
  },
  "links": {
    "self": "/api/v1/goals?page=9&limit=24",
    "first": "/api/v1/goals?page=1&limit=24",
    "last": "/api/v1/goals?page=11&limit=24",
    "next": "/api/v1/goals?page=10&limit=24",
    "prev": "/api/v1/goals?page=8&limit=24"
  }
}