example-data.com
Menu
Browse docs and collections

goals

goals

Page 11 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": 241,
      "userId": 247,
      "name": "Work out 4x per week",
      "category": "habit",
      "targetValue": 4.7,
      "currentValue": 1.4,
      "unit": "sessions/week",
      "deadline": "2027-03-22",
      "isCompleted": false,
      "createdAt": "2025-06-16T21:31:19.295Z"
    },
    {
      "id": 242,
      "userId": 248,
      "name": "Eat 150g protein daily",
      "category": "nutrition",
      "targetValue": 197.6,
      "currentValue": 106.9,
      "unit": "g/day",
      "deadline": "2026-07-02",
      "isCompleted": false,
      "createdAt": "2026-03-23T16:56:28.261Z"
    },
    {
      "id": 243,
      "userId": 248,
      "name": "Reduce body fat",
      "category": "weight",
      "targetValue": 17.4,
      "currentValue": 7.7,
      "unit": "%",
      "deadline": "2026-10-26",
      "isCompleted": false,
      "createdAt": "2025-08-22T01:08:01.217Z"
    }
  ],
  "meta": {
    "page": 11,
    "limit": 24,
    "total": 244,
    "totalPages": 11
  },
  "links": {
    "self": "/api/v1/goals?page=11&limit=24",
    "first": "/api/v1/goals?page=1&limit=24",
    "last": "/api/v1/goals?page=11&limit=24",
    "next": null,
    "prev": "/api/v1/goals?page=10&limit=24"
  }
}