example-data.com
Menu
Browse docs and collections

Overview

accounts / #6

Component variants

Related

Request

curl example

curl -sS \
  "https://example-data.com/api/v1/accounts/6" \
  -H "Accept: application/json"

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/accounts/6"
);
const account = await res.json();

TypeScript example

// Download once: mkdir -p types && curl -o types/accounts.d.ts https://example-data.com/types/accounts.d.ts
import type { Account } from "./types/accounts";

const res = await fetch(
  "https://example-data.com/api/v1/accounts/6"
);
const account = (await res.json()) as Account;

Python example

import requests

res = requests.get(
    "https://example-data.com/api/v1/accounts/6"
)
account = res.json()

Response

{
  "id": 6,
  "userId": 3,
  "name": "Auto Loan",
  "type": "loan",
  "balance": -232013.43,
  "currency": "CAD",
  "isActive": true,
  "createdAt": "2024-08-01T07:07:51.995Z"
}