Skip to main content

Dogwhistle Detection

Identify coded language that appears innocuous but carries hidden harmful meanings.

What it detects:

  • Coded language: Terms with hidden meanings to specific groups
  • Subtlety level: How hidden the messaging is
  • Harm potential: Risk level of the detected content
  • Categories: Types of dogwhistles detected

Reference

See the Dogwhistle Detection API Reference for method signatures and parameters.

Response: DogwhistleResult

By Example

Basic Usage

const result = await client.checkDogwhistle(
"This comment to analyze for coded language",
articleId
);

console.log(`Detected: ${result.detection.dogwhistles_detected}`);
console.log(`Confidence: ${result.detection.confidence.toFixed(2)}`);
console.log(`Reasoning: ${result.detection.reasoning}`);

if (result.details) {
console.log(`Terms: ${result.details.dogwhistle_terms}`);
console.log(`Categories: ${result.details.categories}`);
console.log(`Subtlety: ${result.details.subtlety_level.toFixed(2)}`);
console.log(`Harm potential: ${result.details.harm_potential.toFixed(2)}`);
}

With Custom Detection

Provide context for better detection:

const result = await client.checkDogwhistle(
"Comment text here",
articleId,
["topic-area-1", "topic-area-2"],
["known-coded-phrase", "another-term"]
);