Use this endpoint to get data about a piece of content. By default, it returns a spam score. You can configure it to return more data points including the language and sentiments.
Full URL: https://fortguard.io/api/v0/check/content (POST)
{
"model": "gpt-4o-mini",
"context": "10 Healthy Habits to Boost Your Productivity",
"content": "Click the link in my profile!",
"language_detection": false,
"sentiment_analysis": false,
"sentiments": ['positive', 'negative', 'neutral'],
}The content field is the content to check. It can be a comment, email, or any other text.
Content can be in plain text, Markdown, or HTML. However, we highly recommend sending the content in
Markdown format to include links as well as to reduce length.
On a blog post about Gardening, a comment like "Have you heard about these amazing weight loss pills I found online?" is likely to be spam. But on a blog post about weight loss, it is likely to be a genuine comment. So, the context of the content is critical for accurate spam detection.
Set the context field is the context of the given content. For example, if the
content is a comment, the context can be the title of the article. Setting a context is strongly recommended to get human-like spam detection accuracy.
Maximum length of the context is 255 characters (the excess characters will be truncated).
The content check API uses OpenAI language models for spam detection, language detection, and
sentiment analysis. You can set the model field to one of the following:
gpt-4o-mini (default)gpt-4ogpt-4-turboclaude-3-haikuclaude-3.5-sonnetclaude-3-opusAPI credits consumption depends on the model and the used GPT tokens.
gpt-4o-minigpt-4ogpt-4-turboclaude-3-haikuclaude-3.5-sonnetclaude-3-opus{
"spam_score": 5,
"language_code": null,
"sentiments": [],
}In the response, you will get a spam_score field. The value of the spam_score field will be an integer between 0 and 5. The higher the number, the more likely the content is spam.
If the spam_score is 0, the content is not spam. Generally, you may consider a
content as spam if the spam_score is 4 or 5. However, you
can set your own threshold based on your use case.
In some cases, you may need to restrict the content to a specific language. Instead of having to
call a separate language detection API, you can easily set the language_detection field to true to get the language code of the content. The language code will be a
two-letter code (ISO 639-1). For example, en for English, fr for French, de for German,
etc.
In some cases, you may need to filter out content based on sentiment. You can set the sentiment_analysis field to true to get the sentiment of the content. By default, the following sentiments
will be returned:
You can customize the sentiments to return by setting the sentiments field. For
example, if you want to get offensive and violent content, set the sentiments field
to ['offensive', 'violent']. Then, if the content is offensive or violent, the API
will return the corresponding sentiment.
The output of the sentiment analysis will be an array of sentiments that match the given sentiments. If no sentiments matched, the output will be an empty array.
"sentiments": ["offensive"], // offensive
"sentiments": ["offensive", "violent"], // offensive AND violent
"sentiments": [], // nothing matched