@datafire/text2data
Client library for Text Analytics & Sentiment Analysis API | api.text2data.com
Installation and Usage
npm install --save @datafire/text2data
let text2data = require('@datafire/text2data').create({
PrivateKey: ""
});
.then(data => {
console.log(data);
});
Description
The current api version is v3.4
The api methods listed below can be called directly from this page to test the output. You might set the api_key to pre-authenticate all requests on this page (this will work if your secret is blank).
API endpoint URL: http://{apiName}.text2data.com/v3/ {method}
The api can be consumed directly or using our SDK. Our Excel Add-In and Google Sheets Add-on are also using this api to process the data.
Actions
Analyze_Get
Test api response without api key
text2data.Analyze_Get(null, context)
Input
This action has no parameters
Output
- output DocumentResult
Analyze_Post
Sample request:
POST /Analyze
{
"DocumentText": "Excellent location, opposite a very large mall with wide variety of shops, restaurants and more.",
"PrivateKey": "your_api_key",
"Secret": ""
}
text2data.Analyze_Post({
"requestDoc": {
"DocumentText": "",
"PrivateKey": ""
}
}, context)
Input
- input
object
- requestDoc required Document
Output
- output DocumentResult
Categorize_Get
Test api response without api key
text2data.Categorize_Get(null, context)
Input
This action has no parameters
Output
- output DocumentResult
Categorize_Post
Sample request:
POST /Categorize
{
"DocumentText": "Excellent location, opposite a very large mall with wide variety of shops, restaurants and more.",
"PrivateKey": "your_api_key",
"UserCategoryModelName": "your_model_name",
"Secret": ""
}
text2data.Categorize_Post({
"requestDoc": {
"DocumentText": "",
"PrivateKey": ""
}
}, context)
Input
- input
object
- requestDoc required Document
Output
- output DocumentResult
Extract_Get
Test api response without api key
text2data.Extract_Get(null, context)
Input
This action has no parameters
Output
- output DocumentResult
Extract_Post
Sample request:
POST /Extract
{
"DocumentText": "Excellent location, opposite a very large mall with wide variety of shops, restaurants and more.",
"PrivateKey": "your_api_key",
"UserCategoryModelName": "your_model_name",
"Secret": ""
}
text2data.Extract_Post({
"requestDoc": {
"DocumentText": "",
"PrivateKey": ""
}
}, context)
Input
- input
object
- requestDoc required Document
Output
- output DocumentResult
Definitions
ApiConfig
- ApiConfig
object
- APIPrivateKey
string
- APISecret
string
- BlacklistedWords
array
- items
string
- items
- ErrorMessage
string
- IsRequestStatusOK
boolean
- APIPrivateKey
Category
- Category
object
- CategoryName
string
- Score
number
- CategoryName
Document
- Document
object
- DocumentLanguage
string
- DocumentText required
string
- IsTwitterContent
boolean
- PrivateKey required
string
- RequestIdentifier
string
- Secret
string
- SerializeFormat
integer
- UserCategoryModelName
string
- DocumentLanguage
DocumentResult
- DocumentResult
object
- AutoCategories
array
- items Category
- Citations
array
- items SentencePart
- CloudTagHTML
string
- CoreSentences
array
- items Sentence
- DetectedLanguage
string
- DocSentimentPolarity
string
- DocSentimentResultString
string
- DocSentimentValue
number
- Entities
array
- items SentencePart
- ErrorMessage
string
- Keywords
array
- items SentencePart
- Magnitude
number
- PartsOfSpeech
array
- items PartOfSpeech
- ResultTextHtml
string
- SlangWords
array
- items SlangWord
- Status
integer
- StorageInfo StorageInfo
- Subjectivity
string
- SwearWords
array
- items SlangWord
- Themes
array
- items SentencePart
- Timestamp
integer
- TransactionCurrentDay
integer
- TransactionDailyLimit
integer
- TransactionTotalCreditsLeft
integer
- TransactionUseByDate
string
- UserCategories
array
- items Category
- AutoCategories
PartOfSpeech
- PartOfSpeech
object
- Action
string
- Object
string
- ObjectSentimentPolarity
string
- ObjectSentimentResultString
string
- ObjectSentimentValue
number
- Subject
string
- Text
string
- Action
Sentence
- Sentence
object
- Magnitude
number
- SentenceNumber
integer
- SentimentPolarity
string
- SentimentResultString
string
- SentimentValue
number
- Text
string
- Magnitude
SentencePart
- SentencePart
object
- KeywordType
string
- Magnitude
number
- Mentions
integer
- SentencePartType
string
- SentenceText
string
- SentimentPolarity
string
- SentimentResult
string
- SentimentValue
number
- Text
string
- KeywordType
SlangWord
- SlangWord
object
- SlangWordText
string
- SlangWordTranslation
string
- SlangWordText
StorageInfo
- StorageInfo
object
- CreateDate
string
- DocumentText
string
- IP
string
- IsExcel
boolean
- IsGSExcel
boolean
- IsTwitterMode
boolean
- PrivateKey
string
- RequestIdentifier
string
- UserCategoryModelName
string
- CreateDate