Paywall Detection

Every post content response automatically includes paywall boundary detection. The free_text and paid_text fields precisely split content at the paywall boundary, so you always know exactly what free readers see versus what paid subscribers get.

Built-inAutomatic

Highlights

Automatic with every post content request
Precise paywall boundary detection
free_text field for publicly visible content
paid_text field for subscriber-only content
Boolean is_paid flag on post metadata
No extra API call required

Code Example

javascript
const res = await fetch(
  "https://stackhooks.com/v1/posts/premium-analysis",
  { headers: { Authorization: "Bearer sk_live_..." } }
);
const { data } = await res.json();

if (data.is_paid) {
  console.log("Free preview:", data.free_text.length, "chars");
  console.log("Paid content:", data.paid_text.length, "chars");
} else {
  console.log("Fully free post:", data.free_text.length, "chars");
}

Response

json
{
  "data": {
    "slug": "premium-analysis",
    "title": "Premium Market Analysis",
    "is_paid": true,
    "free_text": "This week in markets... (preview ends here)",
    "paid_text": "Our proprietary model shows... (full analysis)",
    "word_count": 3200,
    "free_word_count": 450,
    "paid_word_count": 2750
  }
}

Start building today

Create a free account and start pulling structured Substack data in minutes.