feedbin / feedbin-api

Feedbin API Documentation
349 stars 26 forks source link

Retrieving read entries, getting entry count #34

Closed jbrayton closed 5 years ago

jbrayton commented 5 years ago

When Unread retrieves articles, it shows status text such as “Retrieving unread articles (500 of 2048)”. It is able to determine the number of remaining articles because it first calls /v2/unread_entries.json, determines which entries in the result it does not have, and then retrieves those entries by calling /v2/entries.json?ids=….

Currently Unread only retrieves articles that are unread or starred, but I am adding the ability to retrieve recent articles that have already been read. Is there a way to get a list of all entry ID values newer a certain date in one API call? This would be ideal for me.

If that is not possible, is there a way to determine the total number of entries that will be returned for a call to /v2/entries.json?since= before iterating through each page of entries? (It looks like I can get an approximation based on the rel="last" link, but I am looking for something more precise.)

Thank you.

benubois commented 5 years ago

Hi @jbrayton,

There isn't a way to get this currently, but it sounds very useful and I'd be happy to add it.

What about a header like X-Feedbin-Entry-Count: 234, when calling /v2/entries.json? This would be contextual based on whatever parameters are present. For example passing since would give you the entry count since the provided date.

jbrayton commented 5 years ago

An X-Feedbin-Entry-Count header on /v2/entries.json would do the trick. Thank you, @benubois!

benubois commented 5 years ago

Hi @jbrayton,

This is now available. The header is called X-Feedbin-Record-Count so it can be re-used with any paginated resource.

Thanks!

jbrayton commented 5 years ago

Thank you, @benubois. I updated my code to take advantage of that, and it appears to work exactly as I had hoped.