# Anyapi Substack Posts API

Get Anyapi Substack Posts data via REST or OpenAny MCP—with pay-per-use pricing, no subscription, and no cookies required. Powered by anyapi, pass parameters such as limit, url, and retrieve structured data including item collection and returned found field for content research and account lookup, and integration reference, ready for production pipelines and AI agent automation.

Documentation: https://openany.si/market/apis/anyapi/substack-posts/
API ID: c2c90830-eae4-4951-9959-6eaba5ced307
Provider: anyapi
Contract revision: 5
Method: POST
Endpoint: https://api.openany.si/v1/agent-apis/anyapi/v1/run/substack.posts
Page update time: 2026-12-03T02:51:23.568Z
Access: OpenAny REST
OpenAny MCP: availability is not supplied by this REST contract. Check get_api on the configured OpenAny MCP server before execution.
Request content type: application/json
Execution mode: sync
Authentication: Authorization: Bearer $OPENANY_API_KEY

## Billing
Price: $0.00039 base + $0.00044 / result
API-key calls use your shared balance. Review the published billing rules before making a paid request.
Price source: OpenAny public API contract. Price update time: not supplied.
Contract update time: 2026-12-03T02:51:23.568Z. This is not a price-change timestamp.
```json
{
  "currency": "USD",
  "mode": "rules",
  "parameters": [
    {
      "default": [
        "anonymous-octopus"
      ],
      "id": "selected_source",
      "location": "body",
      "pointer": "/source",
      "required": false,
      "type": "array"
    },
    {
      "default": false,
      "id": "allow_fallbacks",
      "location": "body",
      "pointer": "/allowFallbacks",
      "required": false,
      "type": "boolean"
    },
    {
      "id": "fields",
      "location": "query",
      "name": "fields",
      "required": false,
      "type": "string"
    },
    {
      "id": "max_items",
      "location": "query",
      "name": "max_items",
      "required": false,
      "type": "integer"
    },
    {
      "id": "summary",
      "location": "query",
      "name": "summary",
      "required": false,
      "type": "boolean"
    },
    {
      "id": "jq",
      "location": "query",
      "name": "jq",
      "required": false,
      "type": "string"
    }
  ],
  "policy_version": 2,
  "sale": {
    "addons": [],
    "base_price_micro_usd": "44401",
    "max_cost_micro_usd": "44400",
    "quantities": [
      {
        "id": "units",
        "label": "官方计费数量",
        "max_quantity": "100",
        "measure": "value",
        "pointer": "/items",
        "price_micro_usd": "440",
        "quantity_scale": 0,
        "source": "response",
        "unit": "result",
        "unit_quantity": "1"
      }
    ],
    "rounding": "ceil",
    "variants": [
      {
        "id": "selected_source_only",
        "label": "指定来源且关闭回退时的原厂基础费",
        "price_micro_usd": "390",
        "when": [
          {
            "op": "eq",
            "parameter": "selected_source",
            "value": [
              "anonymous-octopus"
            ]
          },
          {
            "op": "eq",
            "parameter": "allow_fallbacks",
            "value": false
          },
          {
            "op": "exists",
            "parameter": "fields",
            "value": false
          },
          {
            "op": "exists",
            "parameter": "max_items",
            "value": false
          },
          {
            "op": "exists",
            "parameter": "summary",
            "value": false
          },
          {
            "op": "exists",
            "parameter": "jq",
            "value": false
          }
        ]
      }
    ]
  }
}
```

## Request parameters
```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Anyapi Substack Posts API request inputs",
  "$comment": "Declared input types grouped by HTTP location. Path, query and header values describe decoded inputs and are serialized as text on the wire; body is the payload. This is not an exhaustive provider contract or a schema for the raw HTTP request.",
  "type": "object",
  "properties": {
    "path": {
      "type": "object",
      "properties": {}
    },
    "query": {
      "type": "object",
      "properties": {
        "fields": {
          "type": "string",
          "description": "Optional. Comma-separated keys (dotted paths like `author.name` descend into nested objects) to keep on each result item: each row of the API's result list, or the `data` object itself for an API that returns one record. Keys are matched relative to that item, not against the top-level response envelope, so use `jq` to reshape the whole envelope. Shrinks the response without changing cost."
        },
        "max_items": {
          "type": "integer",
          "description": "Optional. Cap the number of result rows returned; a `_truncated` note reports how many were withheld so you can page via the API's own `limit`. An API that returns one record is not trimmed. Does not change cost.",
          "minimum": 0
        },
        "summary": {
          "type": "boolean",
          "description": "Optional. Return only a structural outline (top-level keys, item counts, and per-field byte sizes) instead of the full data. Does not change cost."
        },
        "jq": {
          "type": "string",
          "description": "Optional. A jq expression applied to the result envelope; its output replaces `output` (multiple outputs collect into an array). Reshape freely, e.g. `jq=.data | {title, description, md: .markdown[:3500]}`. Runs sandboxed with a 250ms / 2MB budget; on failure the full result is returned with a `jqError`. Does not change cost."
        },
        "max_cost_usd": {
          "type": "string",
          "description": "Optional. The most you are willing to pay for this one request, in US dollars (for example 0.05). Any route that would charge more than this is not used, so a request only ever runs on something you can afford. If nothing is available at or below your amount, the request is refused before it runs, nothing is charged, and the message tells you the cheapest price per request so you can raise it. Leave it out to accept the normal price."
        }
      }
    },
    "headers": {
      "type": "object",
      "properties": {
        "Idempotency-Key": {
          "type": "string",
          "description": "Optional wallet idempotency key, scoped to this customer for 24 hours. When the gateway honors the key, this synchronous in-process execution can continue after the caller disconnects, bounded by its execution deadline. A completed replayable result charges normally exactly once and can be replayed without another provider run or charge. A pending duplicate returns 409 idempotency_in_progress; reuse with different request semantics returns 409 idempotency_conflict.",
          "minLength": 1,
          "maxLength": 255
        }
      }
    },
    "body": {
      "type": "object",
      "properties": {
        "allowFallbacks": {
          "type": "boolean",
          "description": "Optional, default true. When false, only the sources listed in `source` may serve; the request is refused with no charge if none of them can. When true, the listed sources are tried first and any other source may serve after them, at the normal price."
        },
        "contentType": {
          "type": "string",
          "description": "Restrict to a single post type, or 'all' (e.g. newsletter).",
          "enum": [
            "all",
            "newsletter",
            "podcast",
            "thread"
          ]
        },
        "endDate": {
          "type": "string",
          "description": "Only return posts published on or before this date, format YYYY-MM-DD (e.g. 2024-12-31). Applied within the most recent 'limit' posts scanned."
        },
        "ignoreSources": {
          "type": "array",
          "description": "Optional. Source ids to skip for this request, taken from this endpoint's `lanes[].source.id`. The cheapest remaining source serves and the price is that of the dearest remaining source. An id that does not serve this endpoint, or that is also in `source`, is rejected as invalid input with no charge; skipping every source is rejected the same way.",
          "items": {
            "type": "string"
          }
        },
        "includeComments": {
          "type": "boolean",
          "description": "Include public comment threads and their direct replies on each post (e.g. true)."
        },
        "includeContent": {
          "type": "boolean",
          "description": "Include the full article body as text, HTML and Markdown. Set false for metadata only, which is faster (e.g. false)."
        },
        "limit": {
          "type": "integer",
          "description": "Maximum number of recent posts to return when given a publication URL (1-100, default 25); ignored for a single post URL, which always returns that one post. You are billed per post returned, so a lower limit costs less.",
          "minimum": 1,
          "maximum": 100
        },
        "maxComments": {
          "type": "integer",
          "description": "Maximum comments collected per post when 'includeComments' is true (0-500, default 20). Costs nothing extra (e.g. 50).",
          "minimum": 0,
          "maximum": 500
        },
        "minComments": {
          "type": "integer",
          "description": "Only return posts with at least this many comments (e.g. 10).",
          "minimum": 0
        },
        "minReactions": {
          "type": "integer",
          "description": "Only return posts with at least this many reactions (e.g. 100).",
          "minimum": 0
        },
        "minWordCount": {
          "type": "integer",
          "description": "Only return posts with at least this many words, which filters out short notes and announcements (e.g. 1000).",
          "minimum": 0
        },
        "onlyFree": {
          "type": "boolean",
          "description": "Return only free (non-paywalled) posts (e.g. true)."
        },
        "preferLatencyUnderMs": {
          "type": "integer",
          "description": "Optional; omit it and routing is unchanged, with the cheapest source serving. Prefer sources whose typical response time (median over the trailing 30 days, as published on this endpoint's lane health) is under this many milliseconds; among those, the cheapest serves. This can raise your price: when the cheapest source misses the target, a faster and dearer one serves, and you are quoted and charged its price. If no source is that fast the request is still served, by whichever source offers the best speed for its price - it is never refused for being slow. Sources we have not timed are tried last. This is a preference, not a guarantee: the median describes past requests and is not a ceiling on this one, and it excludes any wait this request itself asks for. On a paginated walk it applies to the first page only: later pages stay with the source that page chose, at the price it was quoted.",
          "minimum": 1
        },
        "source": {
          "type": "array",
          "description": "Optional. Source ids to prefer, in order, taken from this endpoint's `lanes[].source.id` in /catalog or /apis. Omit it and the cheapest source serves, with automatic failover. Listed sources are tried first in the order given, then the others, unless `allowFallbacks` is false. A single source with `allowFallbacks` false is served only by that source at its price, quoted and charged exactly, with no failover. The price is that of the dearest source that may serve. An id that does not serve this endpoint is rejected as invalid input with no charge; a listed source that is not serving right now is refused with no charge, so omit `source` to be served by another. On a paginated walk, later pages must include the source that served page one, or omit `source`.",
          "items": {
            "type": "string"
          }
        },
        "startDate": {
          "type": "string",
          "description": "Only return posts published on or after this date, format YYYY-MM-DD (e.g. 2024-01-01). Applied within the most recent 'limit' posts scanned, so raise 'limit' to reach older date ranges."
        },
        "url": {
          "type": "string",
          "description": "Either a Substack publication URL / custom domain to fetch its recent posts (e.g. https://www.astralcodexten.com), OR a single post URL to fetch just that one article with full content (e.g. https://www.astralcodexten.com/p/your-book-review)."
        }
      },
      "required": [
        "url"
      ]
    }
  },
  "required": [
    "path",
    "query",
    "headers",
    "body"
  ]
}
```

## Response fields
Source: Inferred from examples; not an exhaustive provider schema.
```json
{
  "type": "object",
  "properties": {
    "output": {
      "type": "object",
      "properties": {
        "data": {
          "type": "object",
          "properties": {
            "items": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "authorHandle": {
                    "type": "string"
                  },
                  "authorName": {
                    "type": "string"
                  },
                  "comments": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "authorHandle": {
                          "type": "string"
                        },
                        "authorImage": {
                          "type": "string"
                        },
                        "authorName": {
                          "type": "string"
                        },
                        "authorUrl": {
                          "type": "string"
                        },
                        "commentId": {
                          "type": "string"
                        },
                        "createdUtc": {
                          "type": "integer"
                        },
                        "isAuthor": {
                          "type": "boolean"
                        },
                        "isPinned": {
                          "type": "boolean"
                        },
                        "reactionCount": {
                          "type": "integer"
                        },
                        "replies": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "authorHandle": {
                                "type": "string"
                              },
                              "authorImage": {
                                "type": "string"
                              },
                              "authorName": {
                                "type": "string"
                              },
                              "authorUrl": {
                                "type": "string"
                              },
                              "commentId": {
                                "type": "string"
                              },
                              "createdUtc": {
                                "type": "integer"
                              },
                              "isAuthor": {
                                "type": "boolean"
                              },
                              "isPinned": {
                                "type": "boolean"
                              },
                              "reactionCount": {
                                "type": "integer"
                              },
                              "restackCount": {
                                "type": "integer"
                              },
                              "text": {
                                "type": "string"
                              }
                            }
                          }
                        },
                        "restackCount": {
                          "type": "integer"
                        },
                        "text": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "contentStatus": {
                    "type": "string"
                  },
                  "createdUtc": {
                    "type": "integer"
                  },
                  "postId": {
                    "type": "string"
                  },
                  "postType": {
                    "type": "string"
                  },
                  "publication": {
                    "type": "object",
                    "properties": {
                      "customDomain": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      },
                      "id": {
                        "type": "string"
                      },
                      "image": {
                        "type": "string"
                      },
                      "language": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "paymentsEnabled": {
                        "type": "boolean"
                      },
                      "subdomain": {
                        "type": "string"
                      },
                      "subscriberCount": {
                        "type": "integer"
                      },
                      "url": {
                        "type": "string"
                      }
                    }
                  },
                  "slug": {
                    "type": "string"
                  },
                  "text": {
                    "type": "string"
                  },
                  "title": {
                    "type": "string"
                  },
                  "url": {
                    "type": "string"
                  },
                  "wordcount": {
                    "type": "integer"
                  },
                  "authorUrl": {
                    "type": "string"
                  },
                  "commentCount": {
                    "type": "integer"
                  },
                  "description": {
                    "type": "string"
                  },
                  "isPaid": {
                    "type": "boolean"
                  },
                  "language": {
                    "type": "string"
                  },
                  "reactionCount": {
                    "type": "integer"
                  },
                  "replyCount": {
                    "type": "integer"
                  },
                  "restackCount": {
                    "type": "integer"
                  },
                  "subtitle": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "found": {
          "type": "boolean"
        }
      }
    }
  }
}
```

## Request example
Scenario: Official example (output fragment; HTTP assumed)
```bash
curl \
  'https://api.openany.si/v1/agent-apis/anyapi/v1/run/substack.posts' \
  -X POST \
  -H "Authorization: Bearer $OPENANY_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "limit": 3,
  "url": "https://www.astralcodexten.com"
}'
```

## Response example
Example from the provider's documentation. Field values in your results will differ.
Sample response · Configured HTTP 200; actual status is unverified.
```json
{
  "output": {
    "data": {
      "items": [
        {
          "authorHandle": "priyanakamura",
          "authorName": "Priya Nakamura",
          "comments": [
            {
              "authorHandle": "devonokafor",
              "authorImage": "https://substackcdn.com/image/fetch/clearheaded/devon-avatar.png",
              "authorName": "Devon Okafor",
              "authorUrl": "https://substack.com/@devonokafor",
              "commentId": "c_88213",
              "createdUtc": 1758600000,
              "isAuthor": false,
              "isPinned": true,
              "reactionCount": 44,
              "replies": [
                {
                  "authorHandle": "priyanakamura",
                  "authorImage": "https://substackcdn.com/image/fetch/clearheaded/priya-avatar.png",
                  "authorName": "Priya Nakamura",
                  "authorUrl": "https://www.clearheaded.blog/people/priya-nakamura",
                  "commentId": "c_88240",
                  "createdUtc": 1758603600,
                  "isAuthor": true,
                  "isPinned": false,
                  "reactionCount": 12,
                  "restackCount": 0,
                  "text": "Glad it landed. Curious how your team names the guess out loud."
                }
              ],
              "restackCount": 2,
              "text": "This matches every planning meeting I have sat through for a decade."
            }
          ],
          "contentStatus": "full",
          "createdUtc": 1758585600,
          "postId": "148302911",
          "postType": "newsletter",
          "publication": {
            "customDomain": "www.clearheaded.blog",
            "description": "Notes on building things without lying to yourself.",
            "id": "pub_5521",
            "image": "https://substackcdn.com/image/fetch/clearheaded/logo.png",
            "language": "en",
            "name": "Clearheaded",
            "paymentsEnabled": true,
            "subdomain": "clearheaded",
            "subscriberCount": 38400,
            "url": "https://www.clearheaded.blog"
          },
          "slug": "why-roadmaps-are-guesses",
          "text": "Every roadmap I have shipped was a guess with a deadline attached.",
          "title": "Why roadmaps are guesses",
          "url": "https://www.clearheaded.blog/p/why-roadmaps-are-guesses",
          "wordcount": 2140
        },
        {
          "authorHandle": "priyanakamura",
          "authorName": "Priya Nakamura",
          "authorUrl": "https://www.clearheaded.blog/people/priya-nakamura",
          "commentCount": 29,
          "comments": [],
          "contentStatus": "preview_only",
          "createdUtc": 1757980800,
          "description": "A shorter standup that actually surfaces risk",
          "isPaid": true,
          "language": "en",
          "postId": "148190442",
          "postType": "newsletter",
          "publication": {
            "id": "pub_5521",
            "name": "Clearheaded",
            "subdomain": "clearheaded",
            "url": "https://www.clearheaded.blog"
          },
          "reactionCount": 501,
          "replyCount": 6,
          "restackCount": 18,
          "slug": "the-three-question-standup",
          "subtitle": "",
          "text": "Most standups answer the same three questions badly. Here is a version that takes six minutes and actually works...",
          "title": "The three-question standup",
          "url": "https://www.clearheaded.blog/p/the-three-question-standup",
          "wordcount": 1420
        },
        {
          "authorHandle": "priyanakamura",
          "authorName": "Priya Nakamura",
          "authorUrl": "https://www.clearheaded.blog/people/priya-nakamura",
          "commentCount": 41,
          "comments": [],
          "contentStatus": "metadata_only",
          "createdUtc": 1757376000,
          "description": "Reader questions from last week's thread",
          "isPaid": false,
          "language": "en",
          "postId": "148075310",
          "postType": "thread",
          "publication": {
            "id": "pub_5521",
            "name": "Clearheaded",
            "subdomain": "clearheaded",
            "url": "https://www.clearheaded.blog"
          },
          "reactionCount": 203,
          "replyCount": 9,
          "restackCount": 5,
          "slug": "ask-me-anything-hiring-your-first-pm",
          "subtitle": "Reader questions from last week's thread",
          "title": "Ask me anything: hiring your first PM",
          "url": "https://www.clearheaded.blog/p/ask-me-anything-hiring-your-first-pm",
          "wordcount": 640
        }
      ]
    },
    "found": true
  }
}
```

## Error handling
400: Check the request fields.
401 / 403: Verify credentials and access permissions.
402: Inspect payment requirements and balance.
429: Respect returned retry guidance.
5xx: Inspect the error and usage record before retrying a paid operation.

Integration guide: https://openany.si/docs/
Agent setup: https://openany.si/SKILL.md
