# Query String Builder API

> Query String Builder converts JSON objects into properly formatted URL query strings with optional encoding.

**Endpoint:** `POST https://api.apiverve.com/v1/querystringbuilder`  
**Category:** Data Conversion  
**Cost:** 1 credit per call  
**Canonical page:** https://apiverve.com/marketplace/querystringbuilder

## Overview

Provides both encoded and unencoded query strings with full URL formatting, perfect for API integration and dynamic URL generation.

## Authentication

Every call carries your key in an `x-api-key` header. The same key works across the whole
APIVerve catalog — there are no per-API subscriptions. Responses always use the same three
top-level keys: `status`, `error`, and `data`.

## Example request

```bash
curl -X POST "https://api.apiverve.com/v1/querystringbuilder" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"params":{"name":"John Doe","age":30,"city":"New York","interests":["coding","music","travel"]},"encode":true}'
```

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `params` | object | Yes | JSON object of parameters |
| `encode` | boolean | No | URL encode parameter values. default true |

## Response fields

- `queryString` — string · Formatted query string with encoded parameter key-value pairs
- `fullURL` — string · Complete query string with leading question mark for URLs
- `encoded` — boolean · Indicates whether URL encoding was applied to parameters
- `paramCount` — number · Total count of unique parameters in the query string

## Sample response

```json
{
  "status": "ok",
  "error": null,
  "data": {
    "queryString": "name=John%20Doe&age=30&city=New%20York&interests=coding&interests=music&interests=travel",
    "fullURL": "?name=John%20Doe&age=30&city=New%20York&interests=coding&interests=music&interests=travel",
    "encoded": true,
    "paramCount": 4
  }
}
```

## Use cases

- **API Integration** — Build query strings for API requests from parameter objects
- **URL Generation** — Generate dynamic URLs with properly encoded query parameters
- **Form Processing** — Convert form data to URL query strings for GET requests
- **Link Building** — Create shareable links with query parameters from structured data

## SDKs

- **npm** — `npm install @apiverve/querystringbuilder` (https://www.npmjs.com/package/@apiverve/querystringbuilder)
- **NuGet** — `dotnet add package APIVerve.API.QueryStringBuilder` (https://www.nuget.org/packages/APIVerve.API.QueryStringBuilder)
- **Source** — https://github.com/apiverve/querystringbuilder-api

## More

- Full reference: https://docs.apiverve.com/ref/querystringbuilder
- Get an API key: https://dashboard.apiverve.com
- Full catalog: https://apiverve.com/marketplace
