Aerostack
search

web-query-parse Edge Function — Web Search

Web Search

Parse a URL query string into a typed object with support for arrays, number/boolean coercion, and bracket notation.

navin @navin verified
Updated Mar 12, 2026
GitHub

Edge function web-query-parse Parse a URL query string into a typed object with support for arrays, number/boolean coercion, and bracket notation.. Deployed on Cloudflare Workers — zero cold starts, globally distributed. Mount it via your Aerostack workspace to call it from any AI agent.

terminal — aerostack cli
$ npx aerostack add navin/web-query-parse
smart_toy

Use with AI Assistants

MCP

Connect Claude, Cursor, or any MCP-compatible client — then call this function by slug

① Add MCP Server

Add this once — access all Aerostack functions from your AI tool.

claude_desktop_config.json
{
  "mcpServers": {
    "aerostack": {
      "url": "https://mcp.aerostack.dev",
      "type": "http"
    }
  }
}

② Call this function

Ask your AI to use the call_function tool with this slug:

call_function
call_function({
  slug: "web-query-parse",
  args: {
    "query": "example_query",
    "options": null
  }
})

web-query-parse — Parse a query string to an object

Convert a raw URL query string into a structured object with optional type coercion and array format support.


API

POST /api/web-query-parse

Request body

Field Type Required Default Description
query string Yes Query string (with or without leading ?)
options.decode boolean No true URL-decode values
options.parseNumbers boolean No false Coerce numeric strings to numbers
options.parseBooleans boolean No false Coerce 'true'/'false' to booleans
options.arrayFormat 'repeat'|'bracket'|'comma' No 'repeat' Array key format

Success response (200)

{
  "success": true,
  "data": {
    "params": { "tag": ["a", "b"], "page": "1" },
    "count": 2
  }
}

Error responses

Code HTTP When
INVALID_INPUT 400 Missing query field
INTERNAL_ERROR 500 Unexpected error

Usage

Direct import
import { webQueryParse } from '@aerostack/functions/web-query-parse';

const result = webQueryParse({
  query: '?tag=js&tag=ts&page=2',
  options: { parseNumbers: true },
});
// { params: { tag: ['js', 'ts'], page: 2 }, count: 2 }

Use Cases

  • Parsing query strings from incoming request URLs in middleware
  • Extracting filter parameters from paginated list APIs
  • Reconstructing state from shareable URL parameters

Metadata

upgrade Version 1.0.0
gavel License MIT
language Language typescript
cloud Provider aerostack

Tags

web
deployed_code

Build and publish your own functions

Write a TypeScript function, deploy it to the edge, and share it with thousands of developers — in minutes.

More Web Search Functions

Browse Web Search Functions →

Frequently asked questions

What does the web-query-parse function do? +

web-query-parse is a serverless edge function for web-search automation written in aerostack. Deploy it to Cloudflare Workers via your Aerostack workspace.

How do I deploy the web-query-parse function? +

Install the Aerostack CLI and run: ```bash aerostack deploy function @navin/web-query-parse ``` It will be live on Cloudflare Workers in seconds.

What runtime does web-query-parse use? +

web-query-parse runs on aerostack on the Cloudflare Workers edge runtime — zero cold starts, globally distributed.

Can I customise the web-query-parse function? +

Yes. Fork the function from your Aerostack dashboard, modify the source, and redeploy. All changes are version-controlled.