logo
Overview

API for Sentence Similarity

LexiContext provides an API Service which eases the process of calculating the semantic similarity between two sentences. API While it is still in BETA, it still provides almost accurate and quick similarity results which you can have a look at in the Try it Out section on the Home Page.

Using the service is as simple as making a POST request to the API endpoint with below mentioned parameters to retrieve the results. Given a pair of sentences to compare, the service will process it and return a Similarity score. In order to make the service more secure and manageable, every user has to register for a Unique API Key using which the user can make all the subsequent requests to the API.

The API service is totally free for use while it is in BETA; serving 100 requests per day per API key. Registering for the service is a simple one step process which requires the user to verify their email address once registered to generate the API Key. Get started now.

Every application that uses our FREE services must attribute LexiContext for the services used. Everything about the API is outlined below.

Base URL-

https://lexicontext-api.onrender.com/api/v1

POST /sentence/similarity

Parameters-

Headers

					

						{ "x-api-key" : "YOUR_API_KEY"}
					
                

Body

					
						{ 
						  "sentence1" : "Your first sentence", 
						  "sentence2": "Your second sentence" 
						}
					
                

Response -

On Success

					
						{
							"success": true,
							"statusCode": 200,
							"message": "string",
							"data": {
								"similarity": SIMILARITY_SCORE,
								"similarityPercentage": SIMILARITY_PERCENTAGE,
								"timestamp": "string"
							},
							"credits": {
							  "name": "string",
							  "description": "string",
							  "createdBy": "string",
							  "createdAt": "string"
							}
						  }
					
                

Invalid Request

					
						{
							"success": false,
							"statusCode": 400,
							"message": "string",
							"errors": [
							  {
								"message": "string"
							  }
							],
							"credits": {
							  "name": "string",
							  "description": "string",
							  "createdBy": "string",
							  "createdAt": "string"
							}
						  }					
                
Usage
This section provides the implementation details for integrating the API Service in various Languages.

Python

              
              
            

JavaScript