Text Processing 1 credit COMPUTE

Case Convert API

Convert text between any naming convention via REST API: camelCase, snake_case, UPPER_SNAKE_CASE, kebab-case, PascalCase, Title Case, and lowercase. Essential for code generation, API response normalization, and data transformation pipelines.

Try it live →

How it works

POST a string and the target case format. The API parses word boundaries intelligently (handles existing camelCase, snake_case, spaces, and hyphens), then re-joins in the target format.

Use cases

API Reference

POST https://slopshop.gg/v1/text-case-convert
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Input parameters

ParameterTypeRequiredDescription
text / input string required The text or data to process

Example response

{
  "data": {
    "result": "processed output",
    "count": 7
  },
  "meta": {
    "credits_used": 1,
    "engine": "real",
    "ms": 4
  }
}

Examples

Three real-world scenarios showing how developers use Case Convert in production.

Example 1
Normalize API response keys
Convert snake_case database column names to camelCase for a JavaScript API response.
curl -X POST https://slopshop.gg/v1/text-case-convert \
  -H "Authorization: Bearer $SLOPSHOP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "user_created_at", "to": "camelCase"}'
Example 2
Generate URL slug
Convert a blog post title to a URL-safe kebab-case slug.
curl -X POST https://slopshop.gg/v1/text-case-convert \
  -H "Authorization: Bearer $SLOPSHOP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "Top 10 API Tools for AI Agents in 2025", "to": "kebab-case"}'
Example 3
Convert for Python variable
Turn a camelCase JS variable name into a Python-style snake_case variable.
curl -X POST https://slopshop.gg/v1/text-case-convert \
  -H "Authorization: Bearer $SLOPSHOP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "userProfileSettings", "to": "snake_case"}'

Code examples

curl

curl -X POST https://slopshop.gg/v1/text-case-convert \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input": "your data here"}'

Python

import requests

response = requests.post(
    "https://slopshop.gg/v1/text-case-convert",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    json={"input": "your data here"}
)
result = response.json()
print(result["data"])

Node.js

const response = await fetch("https://slopshop.gg/v1/text-case-convert", {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({ input: "your data here" })
});
const { data } = await response.json();
console.log(data);

CLI

# Install the Slopshop CLI
npm install -g slopshop

# Set your API key
export SLOPSHOP_KEY=your_api_key

# Call text-case-convert
slop text-case-convert '{"input": "your data here"}'

Pricing

Credits per call
1
credits
Cost per call
$0.001
at Starter tier
Tier
COMPUTE
Pure compute

Credits are purchased in bundles starting at $1 for 1,000 credits. All compute APIs like this one use 1 credit per call — that's $0.001. See all pricing tiers.

Related APIs in Text Processing

View the full API catalog · Try in playground · Documentation