api-ninjas-com Text Similarity API

The Text Similarity API computes the similarity score between two pieces of text using state-of-the-art NLP machine learning models.

Operations 1

POST /v1/textsimilarity Compute text similarity score #

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-similarity-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-similarity-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Ninjas Text Similarity 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 Similarity
  description: The Text Similarity API computes the similarity score between two pieces of text using state-of-the-art NLP machine learning models.
paths:
  /v1/textsimilarity:
    post:
      tags:
      - Text Similarity
      summary: Compute text similarity score
      description: Returns a similarity score between 0 and 1 (1 is similar and 0 is dissimilar) of two given texts.
      operationId: computeTextSimilarity
      security:
      - ApiKeyAuth: []
      requestBody:
        description: Input texts to compare for similarity.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TextSimilarityRequest'
      responses:
        '200':
          description: Successful response with the similarity score.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TextSimilarityResponse'
        '400':
          description: Bad Request - Invalid request format or parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TextSimilarityOpenapi_ErrorResponse'
        '401':
          description: Unauthorized - API key missing or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TextSimilarityOpenapi_ErrorResponse'
        '500':
          description: Internal Server Error - An error occurred on the server.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TextSimilarityOpenapi_ErrorResponse'
components:
  schemas:
    TextSimilarityRequest:
      type: object
      properties:
        text_1:
          type: string
          description: First input text. Maximum 5000 characters.
          maxLength: 5000
        text_2:
          type: string
          description: Second input text. Maximum 5000 characters.
          maxLength: 5000
      required:
      - text_1
      - text_2
    TextSimilarityResponse:
      type: object
      properties:
        similarity:
          type: number
          format: float
          description: A similarity score between 0 and 1 where 1 is similar and 0 is dissimilar.
    TextSimilarityOpenapi_ErrorResponse:
      type: object
      properties:
        message:
          type: string
          description: Error message describing the failure.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
externalDocs:
  description: API Ninjas documentation
  url: https://api-ninjas.com/api