Overview
extract_subscription_terms
$0.04 USDC
MCP: extract_subscription_terms
SDK: extractSubscriptionTerms()
Fetches a public subscription, pricing, or terms page and returns conservative structured signals for trials, renewals, billing frequency, cancellation, refunds, commitments, notice periods, and price changes.
POST /v1/extract-subscription-terms
POST /x402/v1/extract-subscription-terms
When an agent should use it
- Check whether a subscription appears to auto-renew before recommending a plan.
- Attach trial, billing, renewal, cancellation, and refund snippets to a commerce workflow decision.
- Route unclear or low-confidence subscription terms to additional research or human review.
Input fields
Schema ref: #/components/schemas/ExtractSubscriptionTermsInput
| Field | Required | Type | Description |
url |
required |
string |
Public HTTP or HTTPS URL to fetch. Localhost, private IPs, link-local addresses, embedded credentials, unsafe redirects, and non-http(s) schemes are rejected. |
strictness |
optional |
string |
Extraction strictness. Allowed values: low, medium, or high. Higher strictness favors fewer guesses and more null fields when policy language is unclear. |
maxSnippets |
optional |
integer |
Maximum number of evidence snippets to return. Claim verification allows 1 to 8; commerce extraction allows 1 to 10. |
includeRawText |
optional |
boolean |
When true, include raw extracted text in the response. Defaults to false to keep responses compact and avoid returning unnecessary page text. |
Output fields
Schema ref: #/components/schemas/ExtractSubscriptionTermsOutput
| Field | Required | Type | Description |
has_subscription_terms |
required |
boolean |
Whether the page appears to contain subscription, trial, renewal, billing, or cancellation terms. |
trial_available |
required |
boolean,null |
Whether a trial appears to be available. Null means the page does not clearly address trial availability. |
trial_length_days |
required |
integer,null |
Detected trial length in days. Null means no clear trial duration was found. |
billing_frequency |
required |
string,null |
Detected billing cadence, such as monthly or annual. Null means unclear. |
renewal_type |
required |
string,null |
Detected renewal behavior, such as auto-renewal or manual renewal. Null means unclear. |
renewal_price |
required |
string,null |
Detected renewal price language. Null means no clear renewal price was found. |
intro_price |
required |
string,null |
Detected introductory or promotional price language. Null means none was clearly found. |
cancellation_policy |
required |
string,null |
Detected cancellation terms. Null means the page did not clearly address cancellations. |
cancellation_deadline |
required |
string,null |
Detected deadline or timing requirement for cancellation. Null means unclear. |
refund_policy |
required |
string,null |
Detected refund language for subscription charges. Null means unclear. |
minimum_commitment |
required |
string,null |
Detected minimum term or commitment language. Null means none was clearly found. |
notice_period |
required |
string,null |
Detected advance notice requirement. Null means unclear. |
price_change_terms |
required |
string,null |
Detected price-change or renewal-price-change language. Null means unclear. |
important_conditions |
required |
array |
Important policy conditions such as exclusions, item state, deadlines, or proof-of-purchase requirements. |
extracted_snippets |
required |
array |
Short source snippets used by the extraction. Empty array means no concise supporting snippet was available. |
confidence |
required |
number |
Number from 0 to 1 expressing how strongly the extracted signals support the result. Lower confidence means the caller should treat the output as tentative or seek review. |
content_hash |
required |
string |
Hash of the fetched page content for comparison, caching, and lightweight audit trails. |
fetched_at |
required |
string |
ISO timestamp when Primitive402 fetched the source page. |
source_url |
required |
string |
Original URL submitted by the caller. |
final_url |
required |
string,null |
Final fetched URL after safe redirects. Null means no final URL was available. |
raw_text |
optional |
string |
Raw extracted page text. Present only when includeRawText is true. |
curl example
curl -s https://primitive402.dev/v1/extract-subscription-terms \
-H 'content-type: application/json' \
-d '{
"url": "https://example.com/pricing",
"strictness": "medium",
"maxSnippets": 5
}' | jq
TypeScript SDK example
import { createNano402Client } from "@nano402/api/sdk";
const client = createNano402Client({
baseUrl: "https://primitive402.dev"
});
const result = await client.extractSubscriptionTerms({
"url": "https://example.com/pricing",
"strictness": "medium",
"maxSnippets": 5
});
console.log(result);
Example response snippet
{
"has_subscription_terms": true,
"renewal_type": "auto-renewal",
"billing_frequency": "monthly",
"confidence": 0.92
}
Safety notes
- All requested URLs are checked with SSRF protection before fetching.
- The response contains subscription-term extraction signals, not legal advice or guaranteed merchant terms.
- When subscription language is unclear, Primitive402 returns null fields and low confidence instead of guessing.
Common errors
400 invalid_request: request body failed validation.
402 payment_required: the x402 route was called without a valid payment header.
429: rate limit exceeded.
500 internal_error: unexpected server error.