Bytesview API (0.1.1)
API Support: contact@bytesview.com URL: https://www.bytesview.com/contact Terms of Service
Introduction
The Bytesview API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies and also returns with JSON-encoded responses.
Our API uses standard HTTP response codes, for authentication, Success or any failure.
Authentication
The Bytesview API uses API keys to authenticate requests. Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth.
Your Authentication to the API is performed via HTTP authorization. Provide your API key as the basic auth username value. You do not need to provide a password. API requests without authentication will also fail.
API_REQUEST_HEADER
The Content-Type entity header is used to indicate the media type resource is JSON.
API key named X-ACCESS-TOKENS sent as a request header X-ACCESS-TOKENS :- .
Security Scheme Type | API Key |
---|---|
Header parameter name: | X-ACCESS-TOKEN |
HTTP Response Code
These error codes are produced on their given conditions
200 = Successful Operation
400 = Parameter missing
401 = Unauthorized
409 = Parameter duplicate
415 = Unsupported type
422 = Unprocessable entity
429 = Too many requests
500 = Server error
Topic Labeling
The Topic API accepts three parameters data, lang and X-ACCESS-TOKENS, and returns a json response containing one of the predicted label('Accounting / Finance', 'Administrative', 'Architecture / Drafting', 'Art/Design / Entertainment',\ 'Banking / Loan / Insurance', 'Beauty / Wellness', 'Business Development / Consulting', 'Education', \ 'Engineering', 'Hospitality', 'Human Resources', 'Installation / Maintenance / Repair', 'Legal', 'Management',\ 'Manufacturing / Production / Construction / Logistics', 'Marketing / Advertising / PR', 'Medical / Healthcare',\ 'Product Management / Project Management', 'Real Estate', 'Restaurant / Food Services', 'Retail', 'Sales / Customer Care',\ 'Science / Research', 'Security / Law Enforcement', 'Software Development / IT', 'Sports / Fitness',\ 'Travel / Transportation', 'Writing / Editing / Publishing') from the text. The limitation to the number of words you can pass in a single sentence for the API calls is 512.
Adding labeling
Authorizations
Header Parameter
X-ACCESS-TOKEN |
string
Your API key
|
Request Body schema:
data
required
|
object
Passing key-value pairs in json format.
|
lang
required
|
string
Available languages are English(en).
|
Responses
Response Body schema:
key |
object
key-value pairs in json format.
|
label |
string
Predicted label
|
label-key |
string
label-key with integer value( 0, 1, ….., 27) indicates a detected topic form text.
|
percentage |
string
percentage probability
|
Request sample
{ "data": { "0": "Shriram Automall India Limited is hiring for Accounts Department" }, "lang": "en" }
Response sample
200
{ "status":"success" "results":{ "key1": { "label": "Accounting/Finance" , "label-key": 0 , "percentage": "99.02" } } }
422
{ "status": "error", "results": { "code": "ApiUnprocessableEntity", "message": "Unsupported language: Please check ISO code for language(lang)" } }
Intent
The intent API accepts three parameters data, lang and x-access-tokens, and returns a json response containing the overall intention of the input text and confidence score for each of the intent labels (News, Feedback, Promotion, Query, Spam). The limitation to the number of words you can pass in a single sentence for the API calls is 512.
Adding Intent
Authorizations
Header Parameter
X-ACCESS-TOKEN |
string
Your API key
|
Request Body schema:
data
required
|
object
Passing key-value pairs in json format.
|
lang
required
|
string
Available languages are English(en).
|
Responses
Response Body schema:
key |
object
key-value pairs in json format.
|
news |
string
News percentage value in Intent
|
feedabck |
string
Feedback percentage value in Intent
|
promotion |
string
Promotion percentage value in Intent
|
query |
string
Query percentage value in Intent
|
spam |
string
Spam percentage value in Intent
|
label |
integer
0 - (News) , 1 - (Feedback) , 2 - (Promotion) , 3 - (Query) , 4 - (Spam)
|
Request samples
{ "data": { "key1": "Adam Rippon Wins 'Dancing With The Stars' Because It Was Destined" , "key2": "I really like these lip shimmers, but I do wish they would stain a little better and last a little longer." }, "lang": "en" }
Response samples
200
{ "status": "success", "results":{ "key1": { "news": "99.52" , "feedback": "0.18" , "promotion": "0.10", "query": "0.10" , "spam": "0.10", "label": 0 }, "key2": { "news": "0.10" , "feedback": "99.60" , "promotion": "0.10", "query": "0.10" , "spam": "0.10", "label": 1 } } }
422
{ "status": "error", "results": { "code": "ApiUnprocessableEntity", "message": "Unsupported language: Please check ISO code for language(lang)" } }
Name - gender
The name-gender API accepts three parameters data dictionary of name with unique key, lang and x-access-tokens, and the API returns a json response with an detected gender(Male or Female) corresponding unique index.Maximum Character length for each name which is 50.
Adding Name - Gender
Authorizations
Header Parameter
X-ACCESS-TOKEN |
string
Your API key
|
Request Body schema:
data
required
|
object
Passing key-value pairs in json format.
|
Responses
Response Body schema:
key |
object
key-value pairs in json format.
|
gender |
string
The predicted gender of unique key in key-value pair.
|
Request samples
{ "data": { "key1": "alvina" , "key2": "نسترن" , "key3": "ron" "key4": "rinki" "key5": "オウガ" } }
Response samples
200
{ "status": "success", "results" : { "key1": { "gender": "F" , }, "key2": { "gender": "F" , }, "key3": { "gender": "M" , }, "key4": { "gender": "F" , }, "key5": { "gender": "M" , } } }
422
{ "status": "error", "results": { "code": "ApiParameterMissing", "message": "Strings can not be empty" } }
Semantic
The semantic API accepts three parameters data with two strings(string1 and string2), lang and x-access-tokens, and the API returns a json response with an score between 0 and 100. Please ensure there are at least one word in each of the string1 and string2 sentences otherwise the API will return an Parameter missing error.The maximum word limit for both sentence/text is 512.
Adding Semantic
Authorizations
Header Parameter
X-ACCESS-TOKEN |
string
Your API key
|
Request Body schema:
data
required
|
object
Passing key-value pairs in json format.
|
lang
required
|
string
Available languages are English(en).
|
Responses
Response Body schema:
score |
object
The output is a key value pair where key is score(string) and value is semantic score in float upto two decimal places, higher score states the higher confidence of sentences being similar.
|
Request samples
{ "data": { "key1": "A smiling costumed woman is holding an umbrella." , "key2": "A happy woman in a fairy costume holds an umbrella." }, "lang": "en" }
Response samples
200
{
"status": "success",
"results":{
"score": 78.38
}
}
422
{ "status": "error", "results": { "code": "ApiUnprocessableEntity", "message": "Unsupported language: Please check ISO code for language(lang)" } }
Sentiment
The Sentiment API accepts three parameters data, lang and x-access-tokens and returns a json response containing the overall sentiment of the input text and confidence score for each of the sentiment labels (positive, negative and neutral).The limitation to the number of words you can pass in a single sentence for the API calls is 512.
Adding Sentiment
Authorizations
Header Parameter
X-ACCESS-TOKEN |
string
Your API key
|
Request Body schema:
data
required
|
object
Passing key-value pairs in json format.
|
lang
required
|
string
Pass ISO code for the following supported language English, Arabic, Turkish, Japanese, Spanish, French, German, Russian, Chinese(simplified), Swedish, Czech, Danish, Greek, Korean, Latin, Hebrew, Indonesian, Kazakh, Armenian, Azerbaijani, Belarussian, Finnish, Bulgarian, Burmese, Persian, Portuguese, Urdu, Vietnamese, Thai, Hungarian, Italian, Polish, Ukrainian, Uzbek. The default language is english(en).
|
Responses
Response Body schema:
key |
object
Passing key-value pairs in json format.
|
negative |
string
Negative percentage of Sentiment in value of key-value pair.
|
neutral |
string
Neutral percentage of Sentiment in value of key-value pair.
|
positive |
string
Positive percentage of Sentiment in value of key-value pair.
|
label |
integer
0 - (Negative) , 1 - (Neutral) , 2 - (Positive)
|
Request samples
{ "data": { "key1": "Watching Espn's First Take! my favorite morning show! lol Skip is great tv! fyi i am a Witness!" , "key2": "very very sick today had to call out from work... which i really didn't want to do." }, "lang": "en" }
Response samples
200
{ "status": "success", "results":{ "key1": { "negative": "5.93" , "neutral": "0.94" , "positive": "93.13", "label": 2 }, "key2": { "negative": "98.59", "neutral": "0.04", "positive": "1.37", "label": 0 } } }
422
{ "status": "error", "results": { "code": "ApiUnprocessableEntity", "message": "Unsupported language: Please check ISO code for language(lang)" } }
Emotion
The emotion API accepts three parameters data, lang and x-access-tokens and returns a json response containing the overall emotion of the input text and confidence score for each of the emotion labels (Anger, Fear, Happy, Love, Neutral, Sad). The limitation to the number of words you can pass in a single sentence for the API calls is 512.
Adding Emotion
Authorizations
Header Parameter
X-ACCESS-TOKEN |
string
Your API key
|
Request Body schema:
data
required
|
object
Passing key-value pairs in json format.
|
lang
required
|
string
Pass ISO code for the following supported language English, Arabic, Turkish, Japanese, Spanish, French, German, Russian, Chinese(simplified), Swedish, Czech, Danish, Greek, Korean, Latin, Hebrew, Indonesian, Kazakh, Armenian, Azerbaijani, Belarussian, Finnish, Bulgarian, Burmese, Persian, Portuguese, Urdu, Vietnamese, Thai, Hungarian, Italian, Polish, Ukrainian, Uzbek. The default language is english(en).
|
Responses
Response Body schema:
key |
object
key-value pairs in json format.
|
anger |
string
Anger percentage value in Emotion
|
fear |
string
Fear percentage value in Emotion
|
happy |
string
Happy percentage value in Emotion
|
love |
string
Love percentage value in Emotion
|
neutral |
string
Neutral percentage value in Emotion
|
sad |
string
Sad percentage value in Emotion
|
label |
integer
0 - (Anger) , 1 - (Fear) , 2 - (Happy) , 3 - (Love) , 4 - (Neutral) , 5 - (Sad)
|
Request samples
{ "data": { "key1": "At a friend's birthday party with some of my closest friends. It was all very pleasant and one could say that I was happy to have such good friends." , "key2": "I want to buy this great album but unfortunately i don't have enough funds." }, "lang": "en" }
Response samples
200
{ "status": "success", "results":{ "key1": { "anger": "0.04" , "fear": "0.04" , "happy": "98.59", "love": "1.06" , "neutral": "0.03" , "sad": "0.24", "label": 2 }, "key2": { "anger": "0.61" , "fear": "0.05" , "happy": "0.31", "love": "0.49" , "neutral": "0.10" , "sad": "98.45", "label": 2 } } }
422
{ "status": "error", "results": { "code": "ApiUnprocessableEntity", "message": "Unsupported language: Please check ISO code for language(lang)" } }
Feature
The Feature API accepts three parameters data, lang and X-ACCESS-TOKENS, and returns a json response containing the extracted feature(Actor, Year, Review, Title, Gener) from the text. The limitation to the number of words you can pass in a single sentence for the API calls is 512.
Adding Feature
Authorizations
Header Parameter
X-ACCESS-TOKEN |
string
Your API key
|
Request Body schema:
data
required
|
object
Passing key-value pairs in json format.
|
lang
required
|
string
Available languages are English(en).
|
Responses
Response Body schema:
string |
object
string represent unique key present in key-value pairs.
|
tags |
string
The array of features present in string1.
|
Request samples
{ "data": { "1": "This is probably one of the funniest films of the 1980s. Eddie Murphy does a fine job as con man Billy Ray and Dan Ackroyd is great as Louis." , }, "lang": "en" }
Response samples
200
{ "status": "success", "results":{ "1": { "review": ["fine", "funniest"] , "year": "1980s" , "actor": ["dan Ackroyd","eddie murphy","billy ray"] } } }
422
{ "status": "error", "results": { "code": "ApiUnprocessableEntity", "message": "Unsupported language: Please check ISO code for language(lang)" } }
Keywords
The keywords API accepts three parameters data, lang and x-access-tokens, and returns a json containing an array of keywords appearing in the input text.The maximum word limit per single sentence for the API calls is 1000.
Adding Keywords
Authorizations
Header Parameter
X-ACCESS-TOKEN |
string
Your API key
|
Request Body schema:
data
required
|
object
Passing key-value pairs in json format.
|
lang
required
|
string
Pass ISO code for the following supported language English, French, Turkish, German, Japanese, Chinese(simplified), Spanish, Arabic, Russian, Italian, Danish. The default language is english(en).
|
Responses
Response Body schema:
string |
object
string represent unique key present in key-value pairs.
|
tags |
string
The array of keywords present in string1.
|
Request samples
{ "data": { "key1": "Accessories for AirTags appearing online, Apple hasn't announced the tracking fobs" , "key2": "NRAI closes in on multi-million dollar deal with online gaming company" }, "lang": "en" }
422
{ "status": "success", "results":{ "string1": { "tags": [ "Apple","AirTags appearing" ], }, "string2": { "tags": [ "dollar deal","NRAI closes", "online gaming company" ], } } }
Response sample
{ "status": "error", "results": { "code": "ApiUnprocessableEntity", "message": "Unsupported language: Please check ISO code for language(lang)" } }
Name - Entity - Recognition
The NER API accepts three parameters data dictionary of name with unique key, lang and x-access-tokens, and the API returns a json response containing the entities, their category (NAME, PLACE, GROUP OR TIME.The limitation to the number of words you can pass in a single sentence/text for the API calls is 512.
Adding Name, Entity and Recognition
Authorizations
Header Parameter
X-ACCESS-TOKEN |
string
Your API key
|
Request Body schema:
data
required
|
object
Passing key-value pairs in json format.
|
lang
required
|
string
Available languages are English(en).
|
Responses
Response Body schema:
key |
object
key-value pairs in json format.
|
Name |
array of strings
Array names of the detected entity.
|
Entity |
array of strings
Predicted entity(name, place, group or time) of the corresponding name array.
|
Request samples
{ "data": { "key1": "European authorities fined Google a record $5.1 billion on Wednesday for abusing its power in the mobile phone market and ordered the company to alter its practices" , "key2": "Mauritania and the IMF agreed Poverty Reduction arrangement." }, "lang": "en" }
Response samples
200
{ "status": "success", "results":{ "key1": { "Name": [ "Google","Wednesday" ], "Entity": [ "GROUP","TIME" ] }, "key2": { "Name": [ "Mauritiana","IMF" ], "Entity": [ "PLACE","GROUP" ] } } }
422
{ "status": "error", "results": { "code": "ApiUnprocessableEntity", "message": "Unsupported language: Please check ISO code for language(lang)" } }
Client Libraries
Use a client library (SDK) to quickly and easily get started with Bytesview API without having to make HTTP requests directly.
We have libraries for the following languages:
- Python
- PHP
Python
Use the Bytesview Python client library to integrate Bytesview API into your Python application without having to make HTTP requests directly.
Source: BytesView Python Client
Installation:
$ pip install bytesviewapi
Usage:
from bytesviewapi import BytesviewApiClient
# API key authorization, Initialize the client with your API key
api = BytesviewApiClient(api_key="API key")
# Pass your desired strings in a dictionary with unique key
data = {"key1": "We are good here", "key2": "this is not what we expect"}
response = api.sentiment_api(data = data , lang = "en")
PHP
Use the Bytesview PHP client library to integrate Bytesview API into your PHP application without having to make HTTP requests directly.
Source: BytesView PHP bindings
Installation:
$ composer require bytesview/bytesviewapi
Usage:
require_once '../autoload.php';
use BytesviewApi\BytesviewApi;
$bytesviewapiObj = new BytesviewApi(BYTESVIEW_API_KEY);
// Pass your desired strings in an array with unique key
$data = array("key1" => "We are good here", "key2" => "this is not what we expect");
$response = $bytesviewapiObj->sentiment_api($data, 'en');
?>