# Extract Fields as JSON

> Extract Fields as JSON is a paid API for AI agents from api.gadgethumans.com, paid per call via x402, $0.002/call, status unknown (last checked 2026-11-24).

Pulls named fields out of unstructured text and returns them as a JSON object, with null for any absent field.

## Facts

- Endpoint: GET https://api.gadgethumans.com/extract?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-24
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/extract-fields-as-json-fb9ceb22
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_3F1IOEGPzIaDgpMXQmRAd

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability extract-fields-as-json-fb9ceb22
```

Example prompt: Pull out invoice_no, total, currency, and due_date from this invoice text and give me the results as JSON: 'Invoice #4821 issued to Acme Corp. Total due: $1,250.00 USD. Payment due by 2024-02-15.'

## When to prefer this

Choose this endpoint when you need to extract specific named fields from free-form text without writing custom regex or parsing logic. It is ideal for structured data extraction from documents like invoices, receipts, emails, job postings, support tickets, or business cards, especially when the fields vary or the text is inconsistently formatted. Prefer this over regex when field presence is uncertain and you need clean null-safe JSON output.

## Known failure modes

- Text exceeds 6000 character limit — request will be rejected or truncated
- Field names not provided — returns error or empty object
- Ambiguous text may result in incorrect or null extractions
- Malformed comma-separated field list causes parsing errors
- Network timeout for very complex extraction requests

## How this service works

Pull named fields out of unstructured text and get them back as a JSON object, with null for anything absent. Use for invoices, receipts, emails, business cards, job posts, support tickets or any text you would otherwise regex.

## Output

A JSON object where each requested field name is a key mapped to the extracted string value found in the text, or null if the field was not present. The response also includes an 'ok' boolean status field.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "input": {
   "type": "object",
   "properties": {
    "queryParams": {
     "type": "object",
     "required": [
      "text",
      "fields"
     ],
     "properties": {
      "text": {
       "type": "string",
       "description": "Text to extract from (max 6000 characters)"
      },
      "fields": {
       "type": "string",
       "description": "Comma-separated field names, e.g. invoice_no,total,currency,due_date"
      }
     }
    }
   }
  },
  "output": {
   "type": "object",
   "properties": {
    "example": {
     "ok": true
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/extract-fields-as-json-fb9ceb22/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.gadgethumans.com](https://www.zero.xyz/host/api.gadgethumans.com/llms.txt)
