# Variable Name Converter API

> Variable Name Converter transforms variable names between different naming conventions including camelCase, snake_case, PascalCase, and kebab-case. Punctuation that cannot appear in an identifier, such as the parentheses in Order Total ($), separates words and is dropped, so spreadsheet headers convert cleanly.

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

## Overview

Perfect for code refactoring, style guide enforcement, and converting between different programming language naming standards.

## 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/variablenameconverter" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"variables":["myVariableName","another_var_name","SomeClassName","kebab-case-name","CONSTANT_VALUE"],"to":"snake_case"}'
```

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `variables` | array | Yes | Array of variable names to convert (max 100). Every entry must be a string. |
| `to` | string | Yes | Target naming convention. One of: camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE |

## Response fields

  - `results.0.original` — string · Original variable name before conversion · (premium)
  - `results.0.converted` — string · Variable name after conversion to target format · (premium)
- `count` — number · Number of variables converted in the request
- `targetFormat` — string · Target naming convention used for conversion

## Sample response

```json
{
  "status": "ok",
  "error": null,
  "data": {
    "results": [
      {
        "original": "myVariableName",
        "converted": "my_variable_name"
      },
      {
        "original": "another_var_name",
        "converted": "another_var_name"
      },
      {
        "original": "SomeClassName",
        "converted": "some_class_name"
      },
      {
        "original": "kebab-case-name",
        "converted": "kebab_case_name"
      },
      {
        "original": "CONSTANT_VALUE",
        "converted": "c_o_n_s_t_a_n_t__v_a_l_u_e"
      }
    ],
    "count": 5,
    "targetFormat": "snake_case"
  }
}
```

## Use cases

- **Code Refactoring** — Convert variable names when refactoring code between different style guides
- **Language Migration** — Migrate variable naming between programming languages with different conventions
- **Style Enforcement** — Enforce consistent naming conventions across codebases
- **Bulk Conversion** — Convert multiple variable names simultaneously for large-scale refactoring

## SDKs

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

## More

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