JSON Utilities

Json To Query String

Transforms JSON objects into URL-encoded query strings for API calls and web requests. Use via MCP in Cursor or Windsurf, or call GET /v1/json/to-query-string with your JSON payload. Example: `{"name": "John", "age": 30}` becomes `name=John&age=30`. Handles nested objects, arrays, and special characters with proper URL encoding.

API Endpoint

GET /v1/json/to-query-string

Code Examples

curl "https://tinyfn.io/v1/json/to-query-string" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/json/to-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/to-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 does JSON to query string conversion handle nested objects?

Nested objects are typically flattened using dot notation (object.property=value) or bracket notation (object[property]=value), depending on the implementation standard used.

Can I convert arrays in JSON to query string parameters?

Yes, arrays are converted using indexed notation like `items[0]=first&items[1]=second` or repeated parameter names like `tags=red&tags=blue`.

How can AI agents use this tool for API integration tasks?

MCP-enabled agents in Cursor or Claude Code can automatically convert JSON responses into query strings for GET requests, URL building, or form submissions without manual encoding.

What happens to special characters and spaces in the JSON values?

All values are properly URL-encoded, so spaces become `%20`, ampersands become `%26`, and other special characters follow RFC 3986 encoding standards.

Does this tool handle empty values or null fields in JSON?

Empty strings typically become `key=` while null values are either omitted entirely or converted to `key=null` depending on the configuration.

Try Json To Query String Now

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

Get Free API Key