Skip to main content

Megacall (Batch Operations)

Run multiple analysis types in a single API call for efficiency.

Why Use Megacall?

A single request is faster than multiple requests for each kind of analysis. It is also more cost effective, as you are charged for fewer API calls than the individual features in the megacall.

Selecting Which Checks to Run

Each analysis type is optional. Only request what you need to minimize latency and cost.

Use boolean parameters to select analyses:

ParameterAnalysis
include_spam=TrueSpam detection
include_relevance=TrueOn-topic and banned topics check
include_comment_score=TrueFull quality analysis
include_dogwhistle=TrueCoded language detection

Results are None for any analysis not requested.

Basic Usage

result = client.megacall(
"This is a test comment",
article_id,
include_spam=True,
include_relevance=True,
include_comment_score=True,
include_dogwhistle=True
)

# Access results (None if not requested)
if result.spam:
print(f"Is spam: {result.spam.is_spam}")

if result.relevance:
print(f"On topic: {result.relevance.on_topic.on_topic}")

if result.comment_score:
print(f"Overall score: {result.comment_score.overall_score}")

if result.dogwhistle:
print(f"Dogwhistles detected: {result.dogwhistle.detection.dogwhistles_detected}")

With Additional Parameters

result = client.megacall(
"Comment text here",
article_id,
include_spam=True,
include_relevance=True,
include_dogwhistle=True,
banned_topics=['politics', 'religion'],
sensitive_topics=['controversial topic'],
dogwhistle_examples=['known coded phrase']
)