Sentiment Analysis, 50 credits per call.
package hello.world;
import io.twexapi.sdk.XapiScraper;
import io.twexapi.sdk.models.components.SentimentAnalysisQuery;
import io.twexapi.sdk.models.errors.HTTPValidationError;
import io.twexapi.sdk.models.operations.AnalysisSentimentResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws HTTPValidationError, Exception {
XapiScraper sdk = XapiScraper.builder()
.bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
.build();
SentimentAnalysisQuery req = SentimentAnalysisQuery.builder()
.text("<value>")
.build();
AnalysisSentimentResponse res = sdk.analysis().sentiment()
.request(req)
.call();
if (res.sentimentAnalysisResponse().isPresent()) {
System.out.println(res.sentimentAnalysisResponse().get());
}
}
}
| Parameter |
Type |
Required |
Description |
request |
SentimentAnalysisQuery |
✔️ |
The request object to use for the request. |
AnalysisSentimentResponse
| Error Type |
Status Code |
Content Type |
| models/errors/HTTPValidationError |
422 |
application/json |
| models/errors/APIException |
4XX, 5XX |
*/* |