getReadability NLP

getReadability API retrieves readability data and details calculated using different algorithms.

Syntax

getReadability(blockKey: Number) : Promise<object>

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import INKAPI from './inkapi.js'

INKAPI.ready(async () => {

  const NLP = INKAPI.nlp;

  const data = await NLP.getReadability(1);

  console.log(data);

  /*
    Console Output:

    {
      "FleschKincaid": 6.790000000000003,
      "GunningFog": 11.466666666666667,
      "ColemanLiau": 5.988333333333333,
      "SMOG": null,
      "AutomatedReadability": 3.998750000000001,
      "AVGGrade": 7.0609375000000005,
      "FleschKincaidFRES": 67.75500000000001,
      "FleschKincaidFRESGrade": 9,
      "NewDaleChall": 8.837116666666667,
      "NewDaleChallGrade": 11.5,
      "SpacheGrade": 4.844333333333332,
      "AVGIndex": 8.44811111111111,
      "FinalGrade": 8
    }

  */

});

Parameters

Name

Type

Description

blockKey

Number

Required. Key of the block to be selected.

Note

Learn more about how blocks work in INK editor here.