All Projects → c0nn3r → reverse-engineered-grammarly-api

c0nn3r / reverse-engineered-grammarly-api

Licence: other
My attempt to reverse engineer the Grammarly API.

Labels

Projects that are alternatives of or similar to reverse-engineered-grammarly-api

grammarly-editor
Purify Grammarly editing experience
Stars: ✭ 16 (-68.63%)
Mutual labels:  grammarly
grammarly
Grammarly API interface
Stars: ✭ 87 (+70.59%)
Mutual labels:  grammarly
lsp-grammarly
lsp-mode ❤️ grammarly
Stars: ✭ 81 (+58.82%)
Mutual labels:  grammarly
CorrectLy
CorrectLy - Open Source Spelling & Grammar correction
Stars: ✭ 23 (-54.9%)
Mutual labels:  grammarly

Reverse Engineering the Grammarly API

My attempt to reverse engineer the Grammarly API.

First, you need to find a way to look at the web requests when you write. You can't do this just on the page you are using Grammarly on, you need to go to the extention page and inspect the forge.html view.

I'm going to ignore the tracking request to f-log-extension.grammarly.io for now, but here it is for later:

{
    "message": "init in the field",
    "logger": "usage.session.init",
    "level": "INFO",
    "application": "extensionChrome",
    "version": "14.800.1159",
    "env":"prod", 
    "extra_usage":
    {
        "domain": "mail.google.com",
        "accountType": "Free",
        "fieldType": "contenteditable",
        "fieldSupported": true,
        "groupInfo": 328246984
    }
}

Grammarly then opens a connection to wss://capi.grammarly.com/freews.

sent

{
    "token": null,
    "docid": "e769a7d9-37cb-f4e9-c25a-38b24d045c81",
    "client":"extension_chrome",
    "protocolVersion":"1.0",
    "clientVersion":"14.800.1159",
    "extDomain":"mail.google.com",
    "action":"start",
    "id":0
}

sent

{
    "ch": ["+0:0:\n:0"],
    "rev":0,
    "action":"submit_ot",
    "id":1
}

got

{
    "sid":0,
    "action": "start",
    "id":0
}

got

{
    "rev": 0,
    "action": "submit_ot",
    "id": 1
}

sent

{
    "name":"gnar_containerId",
    "value":"r88N2V1wqvv8",
    "action":"option","id":2
}

got

{
    "action": "option",
    "id": 2
}

got

{
    "sid": 1,
    "rev": 0,
    "score": 100,
    "removed": [],
    "errors": 0,
    "interrupts": 0,
    "skipped":0,
    "rejected":0,
    "blocked":0,
    "dialect":"undefined",
    "action":"finished"
}

sent

"ping"

got

{
    "action": "pong"
}

sent

{
    "ch": ["-0:1:\n:0+0:1:o:0"],
    "rev": 1,
    "action": "submit_ot",
    "id": 3
}

got

{
    "rev":1,
    "action": "submit_ot",
    "id": 3
}

got

{"sid":1,"rev":1,"score":100,"removed":[],"errors":0,"interrupts":0,"skipped":0,"rejected":0,"blocked":0,"dialect":"undefined","action":"finished"}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].