Overview
Perspective is a free NLP API from Jigsaw (Google) that scores text for toxic, obscene, insulting, or threatening content, returning a probability between 0 and 1 for each attribute. It is widely used for building comment moderation systems and community safety tools. The API supports multiple languages and can analyze text for a range of harmful content types.
Beginner Tip
Use a threshold of 0.7 or higher for the TOXICITY attribute when auto-moderating comments—lower thresholds can produce too many false positives for legitimate content. Always combine automated scoring with human review for edge cases.
Available Data
The kind of data this API exposes, based on its documentation. We could not call the endpoint to confirm the exact field names.
Example Response
Illustrative shape only — we were not able to call this endpoint (it requires credentials or exposes no public sample URL), so the fields below show the kind of data this API returns rather than a recorded response.
{
"url": "https://example.com",
"safe": true,
"threat_level": "none",
"categories": [
"clean"
],
"scan_date": "2025-01-15T10:00:00Z"
} Field Reference
attributeScores Map of requested attribute names to their score objects (e.g., TOXICITY, INSULT, THREAT). attributeScores.TOXICITY.summaryScore.value Probability score from 0 to 1 that the text is toxic; scores above 0.7 are generally considered high risk. attributeScores.TOXICITY.summaryScore.type Scoring type used, typically 'PROBABILITY' indicating a probability estimate. languages List of language codes detected in or specified for the analyzed text. detectedLanguages Languages automatically detected in the submitted comment text. Implementation Example
Calls a real endpoint of this API. Replace any placeholder credentials with your own key.
const url = "https://commentanalyzer.googleapis.com/v1alpha1/comments:analyze?key=YOUR_API_KEY";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
headers: {
"X-API-Key": "YOUR_API_KEY"
}
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data); What Can You Build?
Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.
Common Errors & Troubleshooting
Generated guidance based on this API's documentation, not observed by us. Treat it as a starting point and check against the provider's own error reference.
Metadata Score Breakdown
Estimated from metadata — endpoint not independently tested
Metadata estimate · endpoint not independently tested
Technical Specifications
Related Tags
Similar APIs
View All →AI For Thai
AI For Thai is a free collection of AI-powered APIs specifically designed for the Thai language, covering NLP tasks like word segmentation, sentiment analysis, and text-to-speech.
Cloudmersive
⭐ Beginner's PickCloudmersive Image Recognition API offers a suite of image processing capabilities including captioning, face detection, NSFW content classification, and object recognition.
Dialogflow
Dialogflow is Google's Natural Language Processing platform that lets you build conversational interfaces like chatbots and voice assistants.
Hirak FaceAPI
⭐ Beginner's PickHirak FaceAPI provides face detection and recognition capabilities including age estimation and gender classification from images.
Imagga
⭐ Beginner's PickImagga is an image recognition API that can automatically tag images with descriptive labels, perform visual search, and detect inappropriate (NSFW) content.