JSON Utilities

Query String To Json

Converts URL query strings into structured JSON objects, handling arrays, nested parameters, and URL decoding automatically. Available via MCP in Cursor and other AI editors at `/v1/json/from-query-string`, or as a REST endpoint. Pass `?name=John&age=25&tags[]=dev&tags[]=api` and get clean JSON with proper data types and array parsing.

API Endpoint

GET /v1/json/from-query-string

Code Examples

curl "https://tinyfn.io/v1/json/from-query-string" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/json/from-query-string', {
  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/from-query-string',
    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

How do I convert URL query parameters to JSON using MCP?

Use the Query String To JSON tool in your MCP-enabled editor like Cursor or Windsurf. It automatically parses query strings into structured JSON objects with proper array handling.

Does the query string parser handle URL encoding and special characters?

Yes, it automatically URL-decodes parameters like `name=John%20Doe` to `{"name": "John Doe"}` and handles special characters, spaces, and encoded symbols correctly.

How are array parameters like tags[] converted to JSON?

Array notation like `tags[]=web&tags[]=api` becomes `{"tags": ["web", "api"]}`. Both bracket notation and duplicate parameter names are supported for arrays.

Can nested objects be parsed from query strings?

Yes, nested parameters like `user[name]=John&user[age]=25` are converted to `{"user": {"name": "John", "age": "25"}}` with proper object nesting.

What happens with empty or malformed query string parameters?

Empty parameters like `?name=&age=25` result in `{"name": "", "age": "25"}`. Malformed parameters are handled gracefully, preserving the original key-value structure where possible.

Try Query String To Json Now

Get your free API key and start using Query String To Json in seconds.

Get Free API Key