Getting read time from api call to post

#1

Hey all :slight_smile:

Is there a way to get the total read time of a post through the Ghost v2 api?

Thanks in advance.

0 Likes

#2

Hey!

There isn’t no, but there’s plenty of third party packages that can help you with that :slight_smile:

Here’s one: https://www.npmjs.com/package/reading-time

1 Like

#3

If you’re using the API in JavaScript, we have a helper that can calculate it for you:

This is the same code used to calculate it in the {{reading_time}} handlebars helper. This code is currently at the SDK level, rather than the API level, because it’s a little intensive. If there’s a lot of request to move it up the the API layer, we can look at doing this in an optimal way.

3 Likes

#4

Ohhh I assumed that it was calculated on post publish/update and stored somewhere. I’ll look into using the helper. Appreciate the quick replies from you and @fabien :]

1 Like

closed #5

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.

0 Likes