Case Converter API
Convert text to lower, UPPER, Title, Sentence, camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE or dot.case in one call.
Send a text (query string, JSON or form field, or raw text body) and get it in ten cases at once: lower, upper, title, sentence, camel, pascal, snake, kebab, constant and dot. Add to with one of these names to receive only that variant in result.
For the programming cases (camel, pascal, snake, kebab, constant, dot) the text is split into words on any non-letter, non-digit character and on lowercase-to-uppercase boundaries, so userId, user_id and user id all give the same parts. Title and sentence case work on the lowercased text and keep spacing and punctuation. Unicode letters, including Vietnamese, are supported.
The input text is limited to 100,000 characters. An unknown to value returns a 400 error listing the valid names.
Parameters
| Name | In | Type | Required | Default | |
|---|---|---|---|---|---|
text | body|query | string | yes | Text to convert (max 100,000 characters). Can also be sent as a raw text body. | |
to | body|query | string | no | Return only one case: lower, upper, title, sentence, camel, pascal, snake, kebab, constant or dot. |
Example
curl -X POST "https://apibox.io.vn/v1/case-convert" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"user profile settings"}'const res = await fetch('https://apibox.io.vn/v1/case-convert', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"text": "user profile settings"
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.post(
"https://apibox.io.vn/v1/case-convert",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={"text": "user profile settings"},
timeout=30,
)
print(res.json())<?php
$ch = curl_init('https://apibox.io.vn/v1/case-convert');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"text":"user profile settings"}',
]);
$response = curl_exec($ch);
print_r(json_decode($response, true));Response
{
"lower": "user profile settings",
"upper": "USER PROFILE SETTINGS",
"title": "User Profile Settings",
"sentence": "User profile settings",
"camel": "userProfileSettings",
"pascal": "UserProfileSettings",
"snake": "user_profile_settings",
"kebab": "user-profile-settings",
"constant": "USER_PROFILE_SETTINGS",
"dot": "user.profile.settings"
}
Use cases
- Convert JSON keys or database columns between snake_case and camelCase
- Generate constant names or CSS class names from labels
- Normalize headings to Title Case or Sentence case
- Build code generators and scaffolding tools
FAQ
How do I get only one case?
Add to, for example to=camel. The response is then {"result": "..."}.
Does it split existing camelCase words?
Yes. A lowercase letter or digit followed by an uppercase letter starts a new word, so exampleText becomes example_text in snake case.
Which case names are supported?
lower, upper, title, sentence, camel, pascal, snake, kebab, constant and dot.
Related APIs
Text Diff
Compare two texts by lines, words, characters, sentences or JSON and get the changes, a similarity score and a unified diff patch.
a-bSlugify
Turn titles into clean URL slugs: accents removed (Vietnamese đ included), custom separator, optional case keeping and maximum length.
123Text Statistics
Count words, characters, sentences, paragraphs and lines, estimate reading and speaking time, and list the most frequent words of a text.