# PennyRail JSON Path Query

> PennyRail JSON Path Query is a paid API for AI agents from pennyrail.vercel.app, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-15).

Extracts a value from a JSON object using dot/bracket path notation (e.g. items[2].name), returning the found status, value, and normalized path deterministically.

## Facts

- Endpoint: POST https://pennyrail.vercel.app/api/bazaar/json-query
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/pennyrail-json-path-query-ab00710a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_6f3drOYyp8TWpYX96LhM4

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 pennyrail-json-path-query-ab00710a -d '<json body>'
```

Example prompt: From this JSON blob, extract the value at path items[2].name and tell me what it is and whether it was found: {"items":[{"name":"alpha"},{"name":"beta"},{"name":"gamma"}]}.

## When to prefer this

Choose this endpoint when you need deterministic, side-effect-free extraction of a single value from a JSON structure using dot or bracket path notation without writing custom code. Ideal for agent pipelines that receive JSON payloads and need to pluck specific fields reliably. Prefer over general-purpose code execution when you want a simple, auditable, no-network lookup that costs only $0.001 per call.

## Known failure modes

- Path not found in the JSON object — returns found: false with no value
- Malformed path syntax (e.g. mismatched brackets) — returns an error or found: false
- Input body is not valid JSON — request may fail with a parse error
- Missing required 'input' field in request body — returns a validation error
- Array index out of bounds — returns found: false

## How this service works

Extract a value from JSON by dot/bracket path such as items[2].name. Deterministic, no network, returns found/value and normalized path. Exact-match PennyRail gap-arbitrage route.

## Output

Returns a JSON object indicating whether the path was found (boolean), the extracted value at that path (any JSON type: string, number, object, array, null), and the normalized canonical form of the provided path expression.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "description": "Input for JSON query.",
     "additionalProperties": true
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/pennyrail-json-path-query-ab00710a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from pennyrail.vercel.app](https://www.zero.xyz/host/pennyrail.vercel.app/llms.txt)
