{"uid":"cap_VY6ZYoIbOVjTb4cJSx0IR","slug":"web2markdown-text-counter-chars-words-lines-bytes-86c57af4","name":"Web2Markdown Text Counter (chars/words/lines/bytes)","description":"Pay-per-call API for AI agents: turn any public web page or PDF into clean, LLM-ready Markdown. $0.002 per call in USDC on Base via x402. No API key, no signup.","url":"https://lin-desk-x402.lindesk.workers.dev/v1/texttools/count?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET","HEAD","DELETE"],"type":"string"},"queryParams":{"type":"object","required":["input"],"properties":{"input":{"type":"string","description":"Input text; max 100 KiB"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"op":{"type":"string"},"meta":{"type":"object","properties":{"chars_in":{"type":"integer"},"chars_out":{"type":"integer"},"elapsed_ms":{"type":"integer"}}},"result":{}}}}}}},"responseSchema":{"type":"json","example":{"op":"count","meta":{"chars_in":16,"chars_out":55,"elapsed_ms":0},"result":{"chars":16,"lines":2,"words":3,"bytes_utf8":24}}},"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_ep8fcr1I3IrTCZt3LyaVN","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 characters, words, lines, and UTF-8 bytes in a given text string","exampleAgentPrompt":"Count the words, characters, lines, and UTF-8 bytes in this text: 'The quick brown fox jumps over the lazy dog.'","exampleUseCases":[{"title":"Validate LLM input size limit","prompt":"Check if this passage fits within a 100,000 character limit — count the characters and bytes in it: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit...'"},{"title":"Word count for a draft document","prompt":"How many words and lines are in this draft paragraph: 'Artificial intelligence is transforming industries worldwide. Companies are investing heavily in automation and machine learning to stay competitive.'?"},{"title":"Measure token-adjacent text stats","prompt":"Before I send this chunk to the AI, tell me how many characters, words, and UTF-8 bytes it is: 'In the beginning was the Word, and the Word was with God.'"}],"resultDescription":"Returns a JSON object with the operation name ('count'), metadata (chars_in, chars_out, elapsed_ms), and a result object containing: chars (character count), lines (line count), words (word count), and bytes_utf8 (UTF-8 byte size of the input text).","failureModes":["Missing required 'input' query parameter returns an error","Input text exceeding 100 KiB limit may be rejected","Non-text or binary input may produce inaccurate counts","Payment failure (402) if USDC payment on Base is not completed"],"whenToPreferThis":"Use this endpoint when you need fast, precise text statistics (character, word, line, and byte counts) for a string — especially useful for validating text against LLM token/character limits, checking content lengths before storage or API submission, or gathering basic readability metrics. Prefer this over client-side counting when operating inside an agent pipeline where a trusted, server-side count is needed.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-11T00:41:32.619Z","isFirstParty":false,"canonicalSlug":"web2markdown-text-counter-chars-words-lines-bytes-86c57af4"}