{"uid":"cap_gWqhQeGy1lxZN73vtaybV","slug":"delx-commerce-substring-count-api-f7a29fff","name":"Delx Commerce — Substring Count API","description":"Pay-per-result APIs for agents. No signup. Exact price. Verifiable delivery. USDC on Base + Solana via x402.","url":"https://commerce.delx.ai/api/v1/x402/count-substr?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"text":{"type":"string","description":"Input field: text."},"needle":{"type":"string","description":"Input field: needle."}}},"responseSchema":{"type":"json","example":{"count":2,"needle":"delx","schema":"delx/util-count-substr/v1"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_NWl2n-i-FQyI0yeY5RYox","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Counts how many times a substring (needle) appears in a given text string, returning an exact occurrence count.","exampleAgentPrompt":"How many times does the word 'error' appear in this log file text: 'error: disk full. warning: retry. error: timeout. error: disk full.'?","exampleUseCases":[{"title":"Keyword frequency audit in content","prompt":"Count how many times the phrase 'climate change' appears in this article text: 'Climate change is accelerating. Scientists warn that climate change poses risks. Addressing climate change requires global action.'"},{"title":"Log file error occurrence check","prompt":"I've got a server log and I need to know how many times the word 'FATAL' shows up in it — can you count the occurrences for me?"},{"title":"Brand mention counter in reviews","prompt":"How many times does 'Delx' appear in this batch of customer feedback text: 'I love Delx products. Delx is reliable. Never heard of Delx before but now I use Delx daily.'?"}],"resultDescription":"Returns a JSON object with the exact count of how many times the needle substring appears in the provided text, the needle itself echoed back, and a schema identifier ('delx/util-count-substr/v1') for verifiability.","failureModes":["Missing 'text' or 'needle' field returns an error","Empty string inputs may return count of 0 or a validation error","Payment failure (402) if USDC payment via x402 is not properly attached","Very large text inputs may time out or be rejected","Case-sensitivity behavior may differ from user expectations"],"whenToPreferThis":"Choose this endpoint when you need a verifiable, pay-per-use substring count with no API key setup — particularly suited for AI agents using x402 micropayments on Base or Solana. Prefer it over rolling your own string search when you need an auditable, on-chain-payment-settled result for compliance or multi-agent workflows.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-01T00:53:47.535Z","isFirstParty":false,"canonicalSlug":"delx-commerce-substring-count-api-f7a29fff"}