api-ninjas-com Text API

The Text API from api-ninjas-com — 4 operation(s) for text.

Operations 4

GET /v1/dictionary Look up word definition #
GET /v1/profanityfilter Detects and censors profanity in text #
GET /v1/textlanguage Detects the language of the given text #
GET /v1/thesaurus Get synonyms and antonyms for a word #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/api-ninjas-com:api-ninjas-com-text-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

api-ninjas-com-text-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Ninjas Text API
  description: 'Combined OpenAPI specification for every API Ninjas endpoint. Requests go to https://api.api-ninjas.com with an `X-Api-Key` header; get a free key at https://api-ninjas.com/register. Human-readable docs: https://api-ninjas.com/api. Index for LLMs: https://api-ninjas.com/llms.txt.'
  version: 1.0.0
  contact:
    name: API Ninjas
    url: https://api-ninjas.com
  license:
    name: Proprietary
servers:
- url: https://api.api-ninjas.com
  description: API Ninjas Production
security:
- ApiKeyAuth: []
tags:
- name: Text
paths:
  /v1/dictionary:
    get:
      tags:
      - Text
      summary: Look up word definition
      description: Returns a string containing definitions for a given word.
      operationId: getDefinition
      parameters:
      - name: word
        in: query
        description: Word to look up.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DictionaryResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DictionaryOpenapi_ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DictionaryOpenapi_ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DictionaryOpenapi_ErrorResponse'
      security:
      - ApiKeyAuth: []
  /v1/profanityfilter:
    get:
      tags:
      - Text
      summary: Detects and censors profanity in text
      description: Screens `text` for profanity and returns a censored version plus a flag indicating whether anything was found. Requires `text`.
      operationId: filterProfanity
      parameters:
      - $ref: '#/components/parameters/TextParam'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProfanityFilterResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProfanityFilterOpenapi_ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProfanityFilterOpenapi_ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProfanityFilterOpenapi_ErrorResponse'
      security:
      - ApiKeyAuth: []
  /v1/textlanguage:
    get:
      tags:
      - Text
      summary: Detects the language of the given text
      description: Detects which language a text is written in, across over 50 supported languages. Requires `text` of at most 1000 characters.
      operationId: detectLanguage
      parameters:
      - name: text
        in: query
        description: Input text (10 words or more recommended). Maximum 1000 characters.
        required: true
        schema:
          type: string
          maxLength: 1000
      responses:
        '200':
          $ref: '#/components/responses/LanguageDetectionSuccess'
        '400':
          $ref: '#/components/responses/TextLanguageOpenapi_BadRequest'
        '401':
          $ref: '#/components/responses/TextLanguageOpenapi_Unauthorized'
        '500':
          $ref: '#/components/responses/TextLanguageOpenapi_InternalServerError'
      security:
      - ApiKeyAuth: []
  /v1/thesaurus:
    get:
      tags:
      - Text
      summary: Get synonyms and antonyms for a word
      description: Returns the synonyms (similar words) and antonyms (opposite meanings) of a single English word. Requires a `word` to look up.
      operationId: getThesaurus
      parameters:
      - name: word
        in: query
        description: Word to look up.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ThesaurusResponse'
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '500':
          description: Internal Server Error
      security:
      - ApiKeyAuth: []
components:
  schemas:
    TextLanguageOpenapi_ErrorResponse:
      type: object
      properties:
        message:
          type: string
          description: Description of the error.
    DictionaryOpenapi_ErrorResponse:
      type: object
      properties:
        message:
          type: string
          description: Error message describing the failure.
        code:
          type: integer
          format: int32
          description: HTTP status code.
    DictionaryResponse:
      type: object
      properties:
        definition:
          type: string
          description: The definition of the requested word.
        word:
          type: string
          description: The word that was looked up.
        valid:
          type: boolean
          description: Indicates if the word is valid.
    LanguageDetectionResponse:
      type: object
      properties:
        iso:
          type: string
          description: 2-letter ISO language code.
        language:
          type: string
          description: The full name of the detected language.
    ProfanityFilterOpenapi_ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message describing the issue.
        code:
          type: integer
          format: int32
          description: HTTP status code.
    ProfanityFilterResponse:
      type: object
      properties:
        original:
          type: string
          description: The original input text.
        censored:
          type: string
          description: The censored version of the input text, with profanity replaced by asterisks.
        has_profanity:
          type: boolean
          description: Indicates whether the input text contains profanity.
    ThesaurusResponse:
      type: object
      properties:
        word:
          type: string
          example: elegant
        synonyms:
          type: array
          items:
            type: string
          example:
          - graceful
          - handsome
          - fine
        antonyms:
          type: array
          items:
            type: string
          example:
          - inelegant
          - unfashionable
          - tasteless
  parameters:
    TextParam:
      name: text
      in: query
      description: Input text. Maximum 1000 characters.
      required: true
      schema:
        type: string
        maxLength: 1000
  responses:
    LanguageDetectionSuccess:
      description: Language detection successful.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LanguageDetectionResponse'
    TextLanguageOpenapi_BadRequest:
      description: Bad request, possibly due to missing or invalid parameters.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/TextLanguageOpenapi_ErrorResponse'
    TextLanguageOpenapi_Unauthorized:
      description: Unauthorized, possibly due to missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/TextLanguageOpenapi_ErrorResponse'
    TextLanguageOpenapi_InternalServerError:
      description: Internal server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/TextLanguageOpenapi_ErrorResponse'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
externalDocs:
  description: API Ninjas documentation
  url: https://api-ninjas.com/api