{"uid":"cap_thj1xwK2MDYTfC4Pjvh1i","slug":"url-to-base64-encoder-22700505","name":"URL to Base64 Encoder","description":"Fetch any public URL and return its content as base64 with the content type and a ready-to-use data URI. Embed images, PDFs and files directly in LLM and API calls without downloading them yourself. Clean JSON.","url":"https://base64encode.use.x402atlas.com/base64-encode-url?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","required":["url"],"properties":{"url":{"type":"string","format":"uri","maxLength":2048,"description":"Public URL of the file to fetch and base64-encode (image, PDF, any file). Absolute http or https; private, loopback and link-local hosts are rejected. Content over 4 MiB is refused. Defaults to the example URL when omitted."}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","required":["url","final_url","content_type","size_bytes","base64","data_uri"],"properties":{"url":{"type":"string","description":"The URL as given by the caller."},"base64":{"type":"string","description":"Standard base64 with padding of the fetched bytes, no line breaks."},"data_uri":{"type":"string","description":"data:<content_type>;base64,<base64>, ready to embed."},"final_url":{"type":"string","description":"URL after redirects (equals url when none)."},"size_bytes":{"type":"integer","description":"Decoded byte length of the fetched content (at most 4194304)."},"content_type":{"type":"string","description":"Media type without parameters; application/octet-stream when the upstream sent none."}}}}}}},"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_6GzhlV6448aS_KLwOXH4a","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 any public URL and returns its content as a base64-encoded string along with content type and a ready-to-use data URI.","exampleAgentPrompt":"Can you fetch the image at https://example.com/photo.jpg and give me a ready-to-use base64 data URI so I can embed it directly in my API call?","exampleUseCases":[{"title":"Embed remote image in LLM prompt","prompt":"I need to pass this product image at https://cdn.mystore.com/items/shirt-blue.png directly to a vision model — can you fetch it and give me a base64 data URI I can embed in the API call?"},{"title":"Inline PDF in API payload","prompt":"I have a contract PDF hosted at https://docs.mycompany.com/contract-2024.pdf and I need to send it inline in a JSON API call — can you fetch it and return the base64 data URI for me?"},{"title":"Embed logo in HTML email without downloading","prompt":"I want to embed our company logo from https://brand.mysite.com/logo.png directly into an HTML email as an inline image — can you convert that URL to a base64 data URI for me?"}],"resultDescription":"A JSON object containing the original URL, the final URL after redirects, the content type (e.g. image/png, application/pdf), the file size in bytes, the standard base64-encoded content (no line breaks), and a ready-to-use data URI in the format data:<content_type>;base64,<base64>.","failureModes":["Private, loopback, or link-local host URLs are rejected with an error","Files larger than 4 MiB (4,194,304 bytes) are refused","Non-public or inaccessible URLs return a fetch error","Malformed or non-absolute URLs fail schema validation","Upstream server errors (e.g. 404, 500) propagate as fetch failures"],"whenToPreferThis":"Use this endpoint when you need to embed a remotely hosted file (image, PDF, or any binary) as a base64 data URI in an LLM prompt, API payload, or HTML — without downloading the file yourself. It is ideal for agents that need to pass file content inline to APIs that accept data URIs or base64 strings, especially when the file is already publicly accessible by URL. Prefer this over manual download-and-encode workflows when operating in serverless or constrained environments.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-20T06:31:55.892Z","isFirstParty":false,"canonicalSlug":"url-to-base64-encoder-22700505"}