JSON Utilities

Get Json Path

Extracts values from JSON objects using JSONPath expressions. Use via MCP in Cursor or Windsurf, or call GET /v1/json/get-path directly. Pass your JSON data and a path like `$.users[0].name` to pull specific values without parsing the entire structure. Returns the exact value at that path, making it perfect for AI agents processing API responses.

API Endpoint

GET /v1/json/get-path

Code Examples

curl "https://tinyfn.io/v1/json/get-path" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/json/get-path', {
  headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests

response = requests.get('https://tinyfn.io/v1/json/get-path',
    headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)

Use via MCP

Add to your AI agent

Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's json tools:

{
  "mcpServers": {
    "tinyfn-json": {
      "url": "https://tinyfn.io/mcp/json",
      "headers": {
        "X-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Learn more about MCP setup →

FAQ

What JSONPath syntax does get-path support?

Standard JSONPath expressions: `$.key` for root properties, `$.array[0]` for array indices, `$.users[*].name` for wildcards, and `$..name` for recursive descent. Supports bracket notation and filtering.

How do I extract nested values from API responses using MCP?

Pass the JSON response and path like `$.data.results[0].id` to the get-path tool. The MCP tool handles parsing and returns just the value you need, perfect for chaining with other operations in Claude Code or Cursor.

What happens if the JSONPath doesn't exist in my data?

Returns null or an appropriate error response if the path is invalid. Always check the result exists before using it in subsequent operations.

Can I use wildcards to get multiple values at once?

Yes, paths like `$.users[*].email` return arrays of matching values. Use `$..price` to find all price fields recursively throughout the JSON structure.

Is this faster than parsing JSON in my application code?

For simple extractions, yes. The tool handles the parsing overhead and returns only what you need, reducing data transfer and processing time in AI workflows.

Try Get Json Path Now

Get your free API key and start using Get Json Path in seconds.

Get Free API Key