Skip to content
Fourohtwo

agents.writerslogic.com/api/v1/magic-bytes

Compares a claimed file type (MIME type and/or file name) with the first bytes of the file, for an agent that is about to open, parse or forward a download. Detects PNG, JPEG, GIF, WebP, ZIP and OOXML (docx/xlsx/pptx), GZIP, PDF, MP4 (ftyp), ELF, PE, RAR, BMP, ICO and HTML, flags an HTML login or error page saved as a PDF/image/archive, and reports truncation from end-of-file markers when the last

BaseAnswering
POSThttps://agents.writerslogic.com/api/v1/magic-bytes

Uptime100% of 4 checks in 30 days

30 days agoToday

Try it

Pays from your browser wallet in USDC on Base or USDG on Robinhood Chain, whichever the endpoint takes. The provider is paid directly; failed calls aren't refunded by Fourohtwo.

The response shows up here.

Call it from an agent

// npm install fourohtwo
import { createPayer } from "fourohtwo";

// One agent key pays USDC on Base or USDG on Robinhood Chain, inside your spending rules.
const pay = createPayer({ privateKey: process.env.AGENT_KEY, maxPerCallUsd: "0.05" });
const res = await pay("https://agents.writerslogic.com/api/v1/magic-bytes", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"head":"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAElFTkSuQmCC","complete":true,"claimedMime":"image/png","claimedName":"logo.png"}),
});
console.log(await res.json());

Example input

{
  "head": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAElFTkSuQmCC",
  "complete": true,
  "claimedMime": "image/png",
  "claimedName": "logo.png"
}
agents.writerslogic.com/api/v1/magic-bytes · x402 API | Fourohtwo