{"uid":"cap_8XVypvb8lVgNioBXuxrcB","slug":"delx-commerce-line-count-api-0aed3601","name":"Delx Commerce Line 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/line-count?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"text":{"type":"string","description":"Input field: text."},"keep_empty":{"type":"boolean","description":"Input field: keep empty."}}},"responseSchema":{"type":"json","example":{"ok":true,"chars":7,"lines":4,"schema":"delx/util-line-count/v1","nonempty_lines":3,"ends_with_newline":true}},"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_dHCbN2dPyBYr4P1nfc5kv","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 lines, characters, non-empty lines, and detects newline endings in a given text string","exampleAgentPrompt":"Count the lines and characters in this text, and tell me how many are non-empty — include empty lines in the count: 'Hello world\\n\\nThis is a test\\nDone'","exampleUseCases":[{"title":"Validate file trailing newline","prompt":"Check whether this file content ends with a newline, and tell me how many lines and characters it has: 'import os\\nimport sys\\n'"},{"title":"Count non-empty lines in code snippet","prompt":"I have this Python function and I want to know how many non-empty lines it has — ignore blank lines. Here it is: 'def foo():\\n    x = 1\\n\\n    return x\\n'"},{"title":"Audit text block line structure","prompt":"Tell me the total line count, non-empty line count, and character count in this block of text, and whether it ends with a newline: 'Line one\\nLine two\\n\\nLine four'"}],"resultDescription":"Returns a JSON object with: ok (boolean success flag), chars (total character count), lines (total line count), nonempty_lines (count of lines with content), ends_with_newline (boolean), and a schema identifier string.","failureModes":["Missing or empty text field returns error","Non-string text input may cause validation failure","Extremely large text strings may time out or be rejected","Malformed JSON request body returns 400-level error"],"whenToPreferThis":"Choose this endpoint when you need a cheap, verifiable, pay-per-call utility to count lines and characters in text without any setup or subscription. Ideal for AI agents that need to audit text structure, validate file formatting conventions (e.g., trailing newlines), or preprocess content before downstream operations. At $0.001 USDC per call with no signup required, it suits high-frequency agent workflows that need deterministic text metrics.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-01T00:54:05.138Z","isFirstParty":false,"canonicalSlug":"delx-commerce-line-count-api-0aed3601"}