# Substack Publication API (substack.publication)

- Canonical page: [https://everyinfra.com/en/substack-api/publication](https://everyinfra.com/en/substack-api/publication?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "substack", "action": "publication", "params": {...}}
- Price: $0.001389 per call ($1.39 per 1,000 requests); failed calls and empty results are not charged
- Returns: single object
- Mode: sync; add "mode": "async" for slow tasks

## Health

- Live health (24h percent, hourly and daily trends): https://api.everyinfra.com/api/v1/social/availability?platform=substack&action=publication

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| url | not declared | yes | not declared | Specifies the target Substack resource link. Use publication homepages for publication and publication_posts, or direct /p/ post links for post and comments. The publication action requires a URL containing a recognizable Substack handle (custom domains may not parse), whereas publication_posts accepts custom domain links directly. |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | The record's unique ID on the platform. Unique only within one platform; IDs can repeat across platforms. |
| handle | platform-native meaning |
| name | Name of the object itself, for account, product and business capabilities. |
| url | Link to the record on the platform. |
| custom_domain | platform-native meaning |
| bio | Profile bio written by the account; may contain line breaks and emoji. |
| language | Content language code (for example zh, en) as judged by the platform; it can be wrong. |
| subscriber_count | platform-native meaning |
| payments_enabled | platform-native meaning |
| avatar_url | Avatar image link. Some platforms return sized CDN links that can expire. |
| cover_url | platform-native meaning |
| platform | Source platform identifier, the same as platform in the request (for example xiaohongshu, tiktok). |
| author_name | Author's display name. |
| author_username | Author's username (@handle), usually usable in URLs. |
| top_posts | platform-native meaning |

## Example

```bash
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "platform": "substack",
  "action": "publication",
  "params": {
    "url": "https://astralcodexten.substack.com"
  }
}'
```

```python
import os
import requests

response = requests.post(
    "https://api.everyinfra.com/api/v1/social",
    headers={"Authorization": f"Bearer {os.environ['EVERYINFRA_API_KEY']}"},
    json={
        "platform": "substack",
        "action": "publication",
        "params": {
            "url": "https://astralcodexten.substack.com",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

Real response to the example request above, captured 2026-09-26T08:56:04Z. `results` and `count` are real with personal information (names, handles, avatars, profile links, contact details) removed. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "substack",
  "action": "publication",
  "results": {
    "handle": "•••",
    "name": "Astral Codex Ten | Scott Alexander",
    "url": "https://astralcodexten.substack.com",
    "custom_domain": "astralcodexten.com",
    "bio": "P(A|B) = [P(A)*P(B|A)]/P(B), all the rest is commentary. Click to read Astral Codex Ten, by Scott Alexander, a Substack publication.",
    "language": "en",
    "payments_enabled": true,
    "avatar_url": "https://substackcdn.com/•••",
    "platform": "substack"
  },
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## Also

- Capability catalog (no key): https://api.everyinfra.com/api/v1/social/catalog?platform=substack
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
