Extract OpenAPI path parameters in template order
Pull the parameter names out of a path template in the exact order they appear: /users/{id}/posts/{postId} gives id, then postId. Repeated names are kept, plain segments are skipped and broken braces are caught. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Text
- /users/{id}/posts/{postId}
- Parameters
- id, postId
Turn a path template into an ordered parameter list
An OpenAPI operation can use a path such as <code>/users/{id}/posts/{postId}</code>, while the surrounding toolchain may need the names <code>id</code> and <code>postId</code> as separate values. This extractor reads the template from the first character to the last and returns parameter names in that same order. Ordering matters because a request builder, mock server, documentation example, or test generator may pair values with the positions where they appear in the URL.
The scan does not sort, deduplicate, rename, or normalize the captured text. If a name occurs twice, it occurs twice in the result, accurately reflecting the supplied template. Static path segments are ignored, so slashes, version labels, punctuation, and ordinary text outside braces do not add noise.
A template without any brace-delimited segments is valid and returns an empty list. This narrow behavior makes the result predictable and easy to incorporate into a larger OpenAPI processing pipeline without hidden transformations.
Catch malformed braces before downstream processing
A missing brace can quietly corrupt later work. For example, a generator might interpret the remainder of a route as one parameter, or a documentation renderer might display a template that can never match a request. The extractor therefore rejects a closing brace that has no preceding opening brace, an opening brace that never closes, and a second opening brace encountered before the current parameter closes.
Its error identifies the brace position, which makes malformed templates faster to diagnose in build logs or interactive tools. Validation happens during the same linear scan used for extraction, so there is no separate parser state that could disagree with the returned list. Balanced templates proceed normally, including repeated parameter names and templates that contain no parameters.
The capability focuses specifically on brace structure; it does not attempt to validate an entire OpenAPI document, verify that declared parameter objects exist, or decide whether a captured name follows a team naming convention.
Put the names to work in your own tools
The returned list is designed to be a small, composable intermediate value. A linter can also run extraction first and stop immediately when brace structure is malformed, avoiding confusing secondary errors. Because the algorithm uses only a deterministic character scan, it performs no network calls, stores no input, uses no random values, and does not depend on the current time.
That makes it safe to repeat in continuous integration and straightforward to cache by input. Send the path template in the <code>text</code> field and read the ordered array from <code>parameters</code>.
What you can do with it
Check operation declarations
Compare extracted names with declared OpenAPI path parameters and flag missing or extra declarations.
Build request forms
Create input controls in the same order that variables occur in the route template.
FAQ
What does the capability return?
It returns a parameters array containing each brace-delimited name in left-to-right order.
Are repeated parameter names removed?
No. Repeated names remain in the result because the output reflects every occurrence in template order.
What happens if a brace is missing?
The template is refused and the position of the faulty brace is reported. That covers a closing brace with no opening one, an opening brace that never closes, and a second opening brace before the first one closes.
What if the path has no parameters at all?
That is a valid template and you simply get an empty list. Static segments, slashes, version labels and any text outside braces never add names to the result.
Does it check my whole OpenAPI document?
No. It reads one path template and checks only its braces. It does not confirm that each parameter is declared, fill in values, resolve server variables or read a complete specification file.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/dev/openapi-path-params-extract \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"/users/{id}/posts/{postId}"}'const res = await fetch("https://api.kit.forhosting.com/dev/openapi-path-params-extract", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"text": "/users/{id}/posts/{postId}"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/dev/openapi-path-params-extract",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"text": "/users/{id}/posts/{postId}"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/dev/openapi-path-params-extract", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"text":"/users/{id}/posts/{postId}"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"text":"/users/{id}/posts/{postId}"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/dev/openapi-path-params-extract", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"text": "/users/{id}/posts/{postId}"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "dev.openapi_path_params_extract",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
It is deterministic, requires no network access, and gives the same result for the same input every time, making it suitable for build scripts, validation steps, editor tools, and automated API workflows.
Catch malformed braces before downstream processing
Those broader checks belong in schema or specification validation.
Use the result in generators, tests, and API tooling
API execution costs $0.002 per request, while the browser version can run locally. Keep in mind that this capability extracts names from one path template; it does not resolve server variables, substitute values, URL-encode segments, or parse a complete YAML or JSON OpenAPI file.
Integration use cases
Generate API tests
Turn route variables into ordered fixture fields before substituting test values into requests.
Technical questions
What happens when a brace is unmatched?
The request fails with an invalid input error that identifies whether the unmatched brace opens or closes and reports its index.
Does it validate a complete OpenAPI document?
No. It examines one path template and its brace structure; it does not parse YAML, JSON, operations, or parameter declarations.
How much does an API request cost?
Each API request costs $0.002. The browser version can run without sending the template to a server.