<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[VigiMod Blog]]></title><description><![CDATA[How to moderate chats, forums and comments with AI: guides, benchmarks and updates from VigiMod, a context-aware moderation API in 26 languages.]]></description><link>https://vigimod.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Sat, 05 Dec 2026 19:38:34 GMT</lastBuildDate><atom:link href="https://vigimod.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Perspective API shuts down on December 31. Here's how to replace it by changing one line]]></title><description><![CDATA[Perspective API shuts down on December 31, 2026. Switch to VigiMod by changing only the host and key: same requests, same answers, 26 languages.]]></description><link>https://vigimod.hashnode.dev/perspective-api-shuts-down-on-december-31-here-s-how-to-replace-it-by-changing-one-line</link><guid isPermaLink="true">https://vigimod.hashnode.dev/perspective-api-shuts-down-on-december-31-here-s-how-to-replace-it-by-changing-one-line</guid><category><![CDATA[api]]></category><category><![CDATA[AI]]></category><category><![CDATA[# content moderation]]></category><category><![CDATA[Tutorial]]></category><category><![CDATA[Web Development]]></category><dc:creator><![CDATA[VigiMod]]></dc:creator><pubDate>Sun, 15 Nov 2026 17:51:19 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6af9ed70f69de21557166708/093153c4-aa5c-42b9-a2ac-7168f40d7ba6.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Google's Jigsaw is turning off Perspective API. It already stopped accepting new users earlier this year, and after <strong>December 31, 2026</strong> it stops answering everyone else.</p>
<p>If you run comments, a forum or a chat with Perspective behind it, that's a few weeks from now. Coral's toxic comment filter, the Discourse plugin, Drupal modules and plenty of homemade scripts all call the same endpoint:</p>
<pre><code>https://commentanalyzer.googleapis.com/v1alpha1/comments:analyze
</code></pre>
<p>This post shows how to point that call somewhere else without rewriting anything.</p>
<blockquote>
<p>Disclosure: this is written by the team behind VigiMod, the API used in the examples. It's free during the beta.</p>
</blockquote>
<h2>The short version</h2>
<p>VigiMod exposes the same path and accepts the same JSON. You change the host and the key:</p>
<pre><code class="language-diff">- https://commentanalyzer.googleapis.com/v1alpha1/comments:analyze?key=PERSPECTIVE_KEY
+ https://api.vigimod.com/v1alpha1/comments:analyze?key=VIGIMOD_KEY
</code></pre>
<p>The request body stays the same, and the response has the same shape (<code>attributeScores.&lt;ATTRIBUTE&gt;.summaryScore.value</code>), so the code that reads it doesn't change either.</p>
<h2>Before and after in Python</h2>
<p>Before:</p>
<pre><code class="language-python">import requests

r = requests.post(
    "https://commentanalyzer.googleapis.com/v1alpha1/comments:analyze",
    params={"key": PERSPECTIVE_KEY},
    json={
        "comment": {"text": message},
        "languages": ["en"],
        "requestedAttributes": {"TOXICITY": {}, "INSULT": {}, "THREAT": {}},
    },
)
scores = {k: v["summaryScore"]["value"] for k, v in r.json()["attributeScores"].items()}
flagged = scores["TOXICITY"] &gt;= 0.8
</code></pre>
<p>After:</p>
<pre><code class="language-python">import requests

r = requests.post(
    "https://api.vigimod.com/v1alpha1/comments:analyze",  # new host
    params={"key": VIGIMOD_KEY},                           # new key
    json={
        "comment": {"text": message},
        "languages": ["en"],
        "requestedAttributes": {"TOXICITY": {}, "INSULT": {}, "THREAT": {}},
    },
)
scores = {k: v["summaryScore"]["value"] for k, v in r.json()["attributeScores"].items()}
flagged = scores["TOXICITY"] &gt;= 0.8
</code></pre>
<h2>With curl</h2>
<pre><code class="language-bash">curl -s "https://api.vigimod.com/v1alpha1/comments:analyze?key=$VIGIMOD_KEY" \
  -H "Content-Type: application/json" \
  -d '{"comment": {"text": "you are an idiot"},
       "requestedAttributes": {"TOXICITY": {}, "INSULT": {}}}'
</code></pre>
<pre><code class="language-json">{
  "attributeScores": {
    "TOXICITY": {"summaryScore": {"value": 1.0, "type": "PROBABILITY"}},
    "INSULT":   {"summaryScore": {"value": 0.9998, "type": "PROBABILITY"}}
  }
}
</code></pre>
<h2>With Node.js</h2>
<pre><code class="language-js">const r = await fetch(
  `https://api.vigimod.com/v1alpha1/comments:analyze?key=${process.env.VIGIMOD_KEY}`,
  {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({
      comment: { text: message },
      requestedAttributes: { TOXICITY: {}, PROFANITY: {} },
    }),
  },
);
const { attributeScores } = await r.json();
const toxicity = attributeScores.TOXICITY.summaryScore.value;
</code></pre>
<h2>Coral, Discourse and Drupal</h2>
<p><strong>Coral.</strong> In Admin → Configure → Moderation, under the Toxic Comment Filter, set the Perspective endpoint to <code>https://api.vigimod.com/v1alpha1</code> and paste your VigiMod key. If your Coral version has a timeout for the check (older versions use <code>TALK_PERSPECTIVE_TIMEOUT</code>, 300 ms by default), give it some room, around 1000 ms: when the answer arrives late, Coral skips the score.</p>
<p><strong>Discourse.</strong> The official Perspective plugin calls Google's host directly and has no setting for it. In your copy of the plugin, replace <code>commentanalyzer.googleapis.com</code> with <code>api.vigimod.com</code>, and put the VigiMod key in <code>perspective_google_api_key</code>.</p>
<p><strong>Drupal and everything else.</strong> Any module or script that lets you set the Perspective URL works as is. If the URL is hardcoded, it's one line.</p>
<h2>Which attributes are supported</h2>
<table>
<thead>
<tr>
<th>Perspective attribute</th>
<th>Scored from</th>
</tr>
</thead>
<tbody><tr>
<td>TOXICITY</td>
<td>toxicity</td>
</tr>
<tr>
<td>SEVERE_TOXICITY</td>
<td>hate and threats (a message that is only rude stays under 0.7)</td>
</tr>
<tr>
<td>IDENTITY_ATTACK</td>
<td>hate</td>
</tr>
<tr>
<td>INSULT</td>
<td>insults</td>
</tr>
<tr>
<td>THREAT</td>
<td>threats</td>
</tr>
<tr>
<td>SEXUALLY_EXPLICIT</td>
<td>sexual content</td>
</tr>
<tr>
<td>PROFANITY (and OBSCENE)</td>
<td>swearing and vulgar language</td>
</tr>
<tr>
<td>FLIRTATION</td>
<td>flirting and sexual advances</td>
</tr>
<tr>
<td>SPAM</td>
<td>unsolicited advertising</td>
</tr>
</tbody></table>
<p>The <code>_EXPERIMENTAL</code> names are accepted too. Attributes that aren't scored (ATTACK_ON_AUTHOR, INCOHERENT, INFLAMMATORY, LIKELY_TO_REJECT, UNSUBSTANTIAL and the bridging ones) return a 400 error that names them, rather than a made-up number.</p>
<h2>What to check before switching</h2>
<p>A few things behave differently, and it's better to know them up front:</p>
<ul>
<li><strong>The scores come from a different model.</strong> They're rescaled so that 0.7 is VigiMod's tuned threshold for each attribute, which means thresholds between 0.7 and 0.9 behave sensibly. Still, watch a few days of real comments before trusting your old numbers blindly.</li>
<li><strong><code>context.entries</code> is read by the model.</strong> The previous messages change the scores, so replies and quotes are judged together with what came before.</li>
<li><strong>Long comments</strong> (over 1,000 characters) are scored in parts, up to 10,000 characters. Each part counts as one message for the rate limit, and <code>spanScores</code> gives you the score of each part.</li>
<li><strong>Nothing is stored.</strong> Comments are scored and discarded. <code>comments:suggestscore</code> is accepted for compatibility, but the suggested scores aren't kept.</li>
<li><strong>Languages:</strong> any language code is accepted. The model understands 26 languages and works best in English, Italian, Spanish, French, German and Portuguese.</li>
</ul>
<h2>Beyond Perspective</h2>
<p>The compatible endpoint is the quick switch. The same key also works with VigiMod's own <code>/moderate</code> endpoint, which adds a few things Perspective never had:</p>
<ul>
<li>custom rules written as plain sentences ("no selling accounts", "no spoilers"), each with its own score;</li>
<li>per-user spam detection;</li>
<li>policies that turn scores into actions (warn, timeout, ban), with a review queue for moderators and webhooks.</li>
</ul>
<p>There's also a public benchmark on HateCheck and Multilingual HateCheck in six languages, with every prediction downloadable: <a href="https://www.vigimod.com/en/benchmark">vigimod.com/en/benchmark</a>.</p>
<h2>Getting a key</h2>
<ol>
<li>Create a free account at <a href="https://www.vigimod.com">vigimod.com</a> and generate an API key.</li>
<li>Swap the host and the key.</li>
<li>Watch a few days of real traffic and adjust thresholds if needed.</li>
</ol>
<p>The full migration guide, with the attribute table and per-tool settings, is at <a href="https://www.vigimod.com/en/perspective-api-alternative">vigimod.com/en/perspective-api-alternative</a>. Questions go to <a href="mailto:support@vigimod.com">support@vigimod.com</a>, or leave them in the comments here.</p>
]]></content:encoded></item></channel></rss>