# API reference (/docs/api)



LinkFetch exposes a small, stable REST surface. Every endpoint is also
available as a [typed MCP tool](/docs/mcp), and every endpoint card
below is generated from the same catalog that powers the in-app
[playground](/playground) — there is exactly one place where endpoint
metadata lives, so prose and runtime never drift.

## Common base [#common-base]

```
Base URL: https://api.linkfetch.io
Auth:     Authorization: Bearer sk_live_...
Format:   application/json (request + response)
```

Path conventions:

* `:slug` — public LinkedIn vanity (the tail of `/in/<slug>` or
  `/company/<slug>`). Always lowercase.
* `:id` — numeric LinkedIn ID (job id, group id, activity id, etc.).
* `:activityId` — the integer in `/feed/update/urn:li:activity:<id>/`.
* `?url=` — convenience: pass any LinkedIn URL and we extract the id.

## Surfaces [#surfaces]

<TopicIndex />

## Response envelope [#response-envelope]

```json
{
  "data": { /* the typed record(s) for this surface */ },
  "meta": {
    "request_id": "req_01HZ...",
    "credits_charged": 5,
    "rate_limit": { "remaining": 4995, "reset_at": "..." },
    "provenance": {
      "source": "extension",
      "fetched_at": "2026-04-23T10:14:22Z",
      "freshness_days": 0
    }
  }
}
```

Errors use the same envelope with a top-level `error` object — see
[Errors](/docs/errors). Empty result sets return `data: []` and are
never charged.

## What to read next [#what-to-read-next]

<Cards>
  <Card title="Authentication" href="/docs/auth" description="Bearer keys, rotation, secret handling." />

  <Card title="Provenance" href="/docs/provenance" description="The shape every row carries." />

  <Card title="Pricing" href="/docs/pricing" description="Per-endpoint credit cost." />

  <Card title="Errors" href="/docs/errors" description="Codes, retries, idempotency." />

  <Card title="Rate limits" href="/docs/rate-limits" description="Per-tier caps + headers." />

  <Card title="Extension" href="/docs/extension" description="How user-session capture works." />
</Cards>
