技能 编程开发 Grammarly API迁移深度解析

Grammarly API迁移深度解析

v20260423
grammarly-migration-deep-dive
本技能深入指导开发者如何将过时的Grammarly Text Editor SDK迁移到最新的REST API。它详细介绍了从客户端嵌入式SDK到服务器端API调用模式的架构转变,并演示了如何使用新的API实现写作评分、AI检测和抄袭检测等功能。
获取技能
88 次下载
概览

Grammarly Migration Deep Dive

Overview

The Grammarly Text Editor SDK was deprecated January 2024. Current APIs are Writing Score (v2), AI Detection (v1), and Plagiarism Detection (v1). This skill covers migrating from the deprecated SDK to the current REST APIs.

Migration: Text Editor SDK to REST APIs

Before (Deprecated SDK)

<!-- The deprecated approach embedded Grammarly in text editors -->
<script src="https://cdn.grammarly.com/grammarly-sdk.js"></script>
<grammarly-editor-plugin client-id="YOUR_ID">
  <textarea></textarea>
</grammarly-editor-plugin>

After (Current REST APIs)

// Server-side scoring replaces client-side editor integration
async function scoreContent(text: string) {
  const token = await getAccessToken();
  const response = await fetch('https://api.grammarly.com/ecosystem/api/v2/scores', {
    method: 'POST',
    headers: { 'Authorization': `Bearer ${token}`, 'Content-Type': 'application/json' },
    body: JSON.stringify({ text }),
  });
  return response.json();
}

Key Differences

Feature Deprecated SDK Current API
Execution Client-side Server-side
Real-time suggestions Yes No
Writing scores No Yes
AI detection No Yes
Plagiarism detection No Yes

Resources

信息
Category 编程开发
Name grammarly-migration-deep-dive
版本 v20260423
大小 1.97KB
更新时间 2026-04-28
语言