Skip to main content

A lightweight client for the feedly api (

Project description


Python client code for the feedly api

Initializing a client

To initialize a client, first you need an access token. To just play around, login to feedly and go to the console. Then find the feedlyToken property. This is your web access token. You can make requests with this token but it will expire. It's not suitable for building an application, but will get you going.

If you're serious about building an app, you probably want to get a developer token. Check the page for more details.

If we assume you saved the token value in a access.token file in your home directory, you can initalize the client as follows:

from pathlib import Path
from feedly.api_client.session import FeedlySession

token = (Path.home() / 'access.token').read_text().strip()
sess = FeedlySession(token)

Clients are lightweight -- you can keep a client around for the lifetime of your program, or you can create a new one when needed. It's a bit more efficient to keep it around. If you do choose to create clients as needed, you should pass in the user's ID in the constructor, otherwise you'll incur a /v3/profile request.

API Oriented Usage

You can use the FeedlySession object to make arbitrary API requests. E.g.:



  "id": "feed/",
  "feedId": "feed/",
  "title": "Feedly Blog",

Object Oriented Usage

Retrieving Articles

Alternatively, you can use the object oriented code, which facilitates common usage patterns. E.g. you can list your user categories:



{'comics': <UserCategory: user/xxx/category/comics>,
 'econ': <UserCategory: user/xxx/category/econ>,
 'global.must': <UserCategory: user/xxx/category/global.must>,
 'politics': <UserCategory: user/xxx/category/politics>,

where xxx is your actual user ID.

It's not necessary to list categories beforehand, if you know the ones that exist, you can get one on the fly:



<UserCategory: user/xxx/category/comics>

Accessing Entries (articles)

If you need to access entries or entry IDs, you can use easily stream them via stream_contents and stream_ids, respectively:

with FeedlySession(auth_token=token) as sess:
    for eid in sess.user.get_category('politics').stream_ids():



Take note of the StreamOptions class. There are important max_count and count properties that control streaming. To download all items, something like this could be done:

opts = StreamOptions(max_count=sys.maxsize) # down all items that exist
opts.count = sys.maxsize # download as many items as possible in every API request
with FeedlySession(auth_token=token) as sess:
    for eid in sess.user.get_category('politics').stream_ids(opts):

Tagging Existing Entries

with FeedlySession(auth_token=token) as sess:

Odds and Ends

Feedly APIs are rate limited. Do not make multiple requests concurrently. You can download quite a few entries at a time, see the previous section for details. Once you get rate limited, the client will stop any attempted requests until you have available quota.

To debug things, set the log level to DEBUG. This will print log messages on every API request.

Token Management

The above examples assume the auth (access) token is valid. However these tokens do expire. Instead of passing the auth token itself, you can create a feedly.session.Auth implementation to refresh the auth token. A file based implementation is already provided (FileAuthStore). Once this is done the client will automatically try to refresh the auth token if a 401 response is encountered.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for feedly-client, version 0.22
Filename, size File type Python version Upload date Hashes
Filename, size feedly-client-0.22.tar.gz (12.6 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page