# Pig Latin API

> Pig Latin translates English text into Pig Latin while preserving designated words from transformation. Pass any sentence along with an optional exclusion list to receive the encoded phrase and confirmed skipped terms.

**Endpoint:** `POST https://api.apiverve.com/v1/piglatin`  
**Category:** Text Processing  
**Cost:** 1 credit per call  
**Canonical page:** https://apiverve.com/marketplace/piglatin

## Overview

A Pig Latin translator API that converts English text to Pig Latin. Submit plain text strings along with an optional array of words you want untouched, and the endpoint converts each non-excluded word into standard Pig Latin and returns the transformed string, so "The square wooden crate" comes back as "Ethay uaresqay oodenway crate" when "crate" is excluded.

It is used in word-game and kids' learning apps, chat bots and Discord commands, novelty text generators and classroom exercises about how language rules work. Because capitalization, punctuation and line breaks survive the translation, you can pass in whole paragraphs and display the result as-is.

The exclusion list is useful for names, brands and technical terms that should stay readable. Any provided exclusion terms are trimmed of whitespace, de-duplicated, and confirmed in the response next to the translated text. The full response is available on every plan, including the Free plan.

## 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/piglatin" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"The square wooden crate was packed to be shipped. To have is better than to wait and hope.","exclusions":["crate","hope"]}'
```

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `text` | string | Yes | The text to encode in Pig Latin |
| `exclusions` | array | No | Words to exclude from encoding |

## Response fields

- `text` — string · Text encoded in Pig Latin format
- `exclusions` — array · The words left untranslated, echoed back after trimming and de-duplication

## Sample response

```json
{
  "status": "ok",
  "error": null,
  "data": {
    "text": "Ethay uaresqay oodenway crate asway ackedpay otay ebay ippedshay. Otay avehay isyay etterbay anthay otay aitway andyay hope.",
    "exclusions": [
      "crate",
      "hope"
    ]
  }
}
```

## Use cases

- **Word Game Mechanics** — Word game developers transform clues or puzzle prompts into Pig Latin while keeping player names and brand terms intact.
- **Chat Filter Plugins** — Social messaging platforms offer playful message filters that translate conversational dialogue on demand before posting to a room.
- **Linguistics Practice Tools** — To teach phonetics and syllable structures, reading software converts sample vocabulary while protecting punctuation and specific instructional terms.
- **Spoiler Text Obfuscation** — Obfuscate plot spoilers in community discussion boards so readers must decode the Pig Latin sentences manually to see details.

## SDKs

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

## More

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