# Citations

Format bibliography entries and in-text citations in over 2,000 journal styles.

> [!info] Two different things called "citation"
> This endpoint produces **formatted** citations for a bibliography. The Citation object
> that tells you where a generated claim came from is a different type entirely.

## Endpoints

| Method | Path | Scope | Credits | Description |
|---|---|---|---|---|
| POST | `/v1/citations` | `citations:write` | 0 | Format a citation |
| GET | `/v1/citation-styles` | `citations:read` | 0 | List/search styles |
| GET | `/v1/citation-styles/{id}` | `citations:read` | 0 | Retrieve a style |

## Parameters

| Parameter | Type | Required | Description |
|---|---|---|---|
| `style` | string | yes | Style ID or slug, e.g. `apa` |
| `source.paper_id` | string | one of | A corpus paper |
| `source.doi` | string | one of | A DOI to resolve |
| `source.csl` | object | one of | CSL-JSON you supply |

Accepting CSL-JSON directly means any reference manager's export can be formatted without a lookup.

## Response

```json
{
  "object": "citation_entry",
  "id": "cite_uny8c7z4za",
  "style": {
    "id": "cstl_28t1c",
    "slug": "apa",
    "name": "American Psychological Association 7th edition",
    "is_numeric": false
  },
  "bibliography_text": "Vaswani, A., et al. (2017). Attention is all you need. NeurIPS.",
  "bibliography_html": "<div class=\"csl-entry\">Vaswani, A., et al. (2017). Attention is all you need. <i>NeurIPS</i>.</div>",
  "in_text": "(Vaswani et al., 2017)"
}
```

Plain text and HTML are both returned so callers are never forced to strip markup.

## Listing styles

```bash
curl "https://api.scispace.com/v1/citation_styles?query=vancouver&limit=3" \
  -H "Authorization: Bearer $SCISPACE_API_KEY" \
  -H "SciSpace-Version: 2026-08-01"
```

```json
{
  "object": "list",
  "data": [
    {
      "object": "citation_style",
      "id": "cstl_28t1c",
      "name": "Vancouver",
      "short_name": "vancouver",
      "category": "numeric"
    },
    {
      "object": "citation_style",
      "id": "cstl_9fk2d",
      "name": "Vancouver (superscript)",
      "short_name": "vancouver-superscript",
      "category": "numeric"
    },
    {
      "object": "citation_style",
      "id": "cstl_4b7ns",
      "name": "Vancouver (brackets)",
      "short_name": "vancouver-brackets",
      "category": "numeric"
    }
  ],
  "has_more": true,
  "next_cursor": "cstl_4b7ns"
}
```

The catalogue holds **2,000+ styles**, so list with a `query` rather than paging the whole set.
Omit `query` and you get every style, 100 per page, in alphabetical order.

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | no | Case-insensitive match on `name` and `short_name` |
| `category` | enum | no | `numeric`, `author-date`, `note`, `label` |
| `limit` | integer | no | 1–100, default 20 |
| `cursor` | string | no | From `next_cursor` |

> [!info] Style IDs are stable
> A `cstl_` id always refers to the same style, so you can persist a user's choice. Style *output*
> tracks upstream CSL updates, so a re-render may differ in punctuation.

## Errors

| Status | `code` | When |
|---|---|---|
| 404 | `style_not_found` | unknown style |
| 400 | `csl_invalid` | malformed CSL-JSON |
| 422 | `insufficient_metadata` | not enough fields for this style |

## Related

citation · papers · reference-manager-sync
