Skip to main content

Fetches and converts data between Facebook, Google+, Instagram, and Twitter native APIs, ActivityStreams, microformats2 HTML and JSON, Atom, and more.

Project description


This is a library and REST API that fetches and converts social network
data between a wide variety of formats:
- Facebook, Google+, Instagram, and Twitter native APIs
- `ActivityStreams <>`__
- `microformats2 <>`__ HTML
- `microformats2 <>`__ JSON
- `Atom <>`__

You can try it out with these interactive demos:

`Check out the docs for more! <>`__

License: This project is placed in the public domain.


The library and REST API are both based on the
`OpenSocial Activity Streams service <>`__.

Let's start with an example. This code using the library:

.. code:: python

from granary import twitter

is equivalent to this ``HTTP GET`` request:


They return the authenticated user's Twitter stream, ie tweets from the
people they follow. Here's the JSON output:

.. code:: json

"itemsPerPage": 10,
"startIndex": 0,
"totalResults": 12
"items": [{
"verb": "post",
"id": ",2013:374272979578150912"
"url": "",
"content": "Getting stuff for barbecue tomorrow. No ribs left! Got some nice tenderloin though. (@ Metro Plus Famille Lemay)",
"actor": {
"username": "evanpro",
"displayName": "Evan Prodromou",
"description": "Prospector.",
"url": "",
"object": {
"tags": [{
"url": "",
"startIndex": 113,
"length": 22,
"objectType": "article"
}, ...],
}, ...]

`Check out the docs for more! <>`__

Project details

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page