{"uid":"cap_qzjZ5ypLhqf0NUbfSFr4t","slug":"extract-code-as-json-08774680","name":"extract-code-as-json","description":"Extract the page's code as json: fetches the URL, pulls every code element and returns them as a JSON array, with a count. Structured, one-element-type extraction for agents and pipelines; no browser needed. $0.01 per page.","url":"https://page.intel.rallylive.ca/page/code/json?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"],"type":"string"},"queryParams":{"type":"object","properties":{}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object"}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","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.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_rumR40pIIgFw_-eO9uaWc","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Fetches a web page URL and returns all code elements as a structured JSON array with a count, no browser required.","exampleAgentPrompt":"Can you extract all the code elements from https://example.com/docs/quickstart and give me them back as a JSON array?","exampleUseCases":[{"title":"Scrape code samples from docs page","prompt":"Pull all the code blocks from https://docs.python.org/3/tutorial/introduction.html and return them as a JSON array so I can review the examples."},{"title":"Audit code snippets on a blog post","prompt":"Fetch all the code elements from https://css-tricks.com/some-article and tell me how many there are and what they contain."},{"title":"Feed code blocks into a processing pipeline","prompt":"Extract every code element from https://github.com/some/repo/blob/main/README.md as structured JSON so I can pass them into my analysis pipeline."}],"resultDescription":"A JSON array where each element contains one code block found on the page, along with a count of how many code elements were extracted in total.","failureModes":["URL is unreachable or returns a non-200 status — may return an empty array or error","Page has no <code> elements — returns an empty array with count of 0","Dynamically rendered code (JavaScript-required) may not be captured since no browser is used","Malformed URL input results in a request error","Rate limiting or network timeouts on the target page may cause failures"],"whenToPreferThis":"Choose this endpoint when you need to extract only code elements from a page in a clean, structured JSON format without running a browser. It is ideal for agent pipelines and automation workflows that need machine-readable code snippets from documentation, tutorials, or technical blog posts at low cost ($0.01/call).","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-20T18:57:06.602Z","isFirstParty":false,"canonicalSlug":"extract-code-as-json-08774680"}