GET /read/following/

Get a list of posts from the blogs a user follows.

Resource Information

   
Method GET
URL https://public-api.wordpress.com/rest/v1.1/read/following/
Requires authentication? Yes

Query Parameters

Parameter Type Description
http_envelope (bool)
false:
(default)
true:
Some environments (like in-browser JavaScript or Flash) block or divert responses with a non-200 HTTP status code. Setting this parameter will force the HTTP status code to always be 200. The JSON response is wrapped in an "envelope" containing the "real" HTTP status code and headers.
pretty (bool)
false:
(default)
true:
Output pretty JSON
meta (string) Optional. Loads data from the endpoints found in the 'meta' part of the response. Comma-separated list. Example: meta=site,likes
fields (string) Optional. Returns specified fields only. Comma-separated list. Example: fields=ID,title
callback (string) An optional JSONP callback function.
number (int) The number of posts to return. Limit: 40. Default: 10.
page (int) Return the Nth 1-indexed page of posts.
order (string)
DESC:
(default) Return posts in descending order. For dates, that means newest to oldest.
ASC:
Return posts in ascending order. For dates, that means oldest to newest.
after (iso 8601 datetime) Return posts dated after the specified datetime.
before (iso 8601 datetime) Return posts dated before the specified datetime.

Response Parameters

Parameter Type Description
ID (int) The post ID.
site_ID (int) The site ID.
author (object) The author of the post.
date (iso 8601 datetime) The post's creation time.
modified (iso 8601 datetime) The post's most recent update time.
title (html) context dependent.
URL (url) The full permalink URL to the post.
short_URL (url) The wp.me short URL.
content (html) context dependent.
excerpt (html) context dependent.
slug (string) The name (slug) for the post, used in URLs.
guid (string) The GUID for the post.
status (string)
publish:
The post is published.
draft:
The post is saved as a draft.
pending:
The post is pending editorial approval.
private:
The post is published privately
future:
The post is scheduled for future publishing.
trash:
The post is in the trash.
auto-draft:
The post is a placeholder for a new post.
sticky (bool) Is the post sticky?
password (string) The plaintext password protecting the post, or, more likely, the empty string if the post is not password protected.
parent (object|false) A reference to the post's parent, if it has one.
type (string) The post's post_type. Post types besides post, page and revision need to be whitelisted using the rest_api_allowed_post_types filter.
comments_open (bool) Is the post open for comments?
pings_open (bool) Is the post open for pingbacks, trackbacks?
likes_enabled (bool) Is the post open to likes?
sharing_enabled (bool) Should sharing buttons show on this post?
comment_count (int) The number of comments for this post.
like_count (int) The number of likes for this post.
i_like (bool) Does the current user like this post?
is_reblogged (bool) Did the current user reblog this post?
is_following (bool) Is the current user following this blog?
global_ID (string) A unique WordPress.com-wide representation of a post.
featured_image (url) The URL to the featured image for this post if it has one.
post_thumbnail (object) The attachment object for the featured image if it has one.
format (string)
standard:
Standard
aside:
Aside
chat:
Chat
gallery:
Gallery
link:
Link
image:
Image
quote:
Quote
status:
Status
video:
Video
audio:
Audio
geo (object|false)
menu_order (int) (Pages Only) The order pages should appear in.
publicize_URLs (array) Array of Twitter and Facebook URLs published by this post.
tags (object) Hash of tags (keyed by tag name) applied to the post.
categories (object) Hash of categories (keyed by category name) applied to the post.
attachments (object) Hash of post attachments (keyed by attachment ID).
metadata (array) Array of post metadata keys and values. All unprotected meta keys are available by default for read requests. Both unprotected and protected meta keys are available for authenticated requests with access. Protected meta keys can be made available with the rest_api_allowed_public_metadata filter.
meta (object) API result meta data
current_user_can (object) List of permissions. Note, deprecated in favor of `capabilities`
capabilities (object) List of post-specific permissions for the user; publish_post, edit_post, delete_post
date_range (object) date range covered by current results.
number (int) The number of posts brought back by current query.
posts (array) An array of post objects.

Resource Errors

These are the possible errors returned by this endpoint.

HTTP Code Error Identifier Error Message
403 unauthorized User cannot view taxonomy
403 unauthorized User cannot view post
403 authorization_required An active access token must be used to query information about the current user.
403 unauthorized User cannot edit taxonomy
400 invalid_post Invalid post
400 invalid_context Invalid API CONTEXT
403 unauthorized User cannot edit post
404 unknown_post Unknown post

Example

curl \
 -H 'authorization: Bearer YOUR_API_TOKEN' \
 'https://public-api.wordpress.com/rest/v1/read/following/?number=2'
<?php
$options  = array (
  'http' => 
  array (
    'ignore_errors' => true,
    'header' => 
    array (
      0 => 'authorization: Bearer YOUR_API_TOKEN',
    ),
  ),
);

$context  = stream_context_create( $options );
$response = file_get_contents(
	'https://public-api.wordpress.com/rest/v1/read/following/?number=2',
	false,
	$context
);
$response = json_decode( $response );
?>

Response

{
    "date_range": {
        "before": "2016-06-24T15:03:20-04:00",
        "after": "2016-06-24T15:03:20-04:00"
    },
    "number": 1,
    "posts": [
        {
            "ID": 35521,
            "site_ID": 70135762,
            "author": {
                "ID": 68029756,
                "login": "longreadseditors",
                "email": false,
                "name": "Longreads",
                "first_name": "Longreads",
                "last_name": "",
                "nice_name": "longreadseditors",
                "URL": "",
                "avatar_URL": "https:\/\/1.gravatar.com\/avatar\/77c994c441138efdb7338403caac1014?s=96&d=identicon&r=G",
                "profile_URL": "http:\/\/en.gravatar.com\/longreadseditors",
                "site_ID": 70135762
            },
            "date": "2016-06-24T15:03:20-04:00",
            "modified": "2016-06-24T16:58:58-04:00",
            "title": "The Top 5 Longreads of the Week",
            "URL": "http:\/\/blog.longreads.com\/2016\/06\/24\/the-top-5-longreads-of-the-week-123\/",
            "short_URL": "http:\/\/wp.me\/p4KhvY-9eV",
            "content": "<p><em>Below, our favorite stories of the week. Kindle users, you can also get them <a href=\"http:\/\/readlists.com\/f3dccf06\">as a Readlist.<\/a><\/em><\/p>\n<p><em><a href=\"http:\/\/longreads.us2.list-manage2.com\/subscribe?u=1854296747731744c923a33ef&amp;id=bd2ad42066\">Sign up to receive this list free every Friday in your inbox.<\/a><\/em><\/p>\n<p style=\"text-align:center;\">* * *<\/p>\n<h2 class=\"top5-title\"><a href=\"http:\/\/www.motherjones.com\/politics\/2016\/06\/cca-private-prisons-corrections-corporation-inmates-investigation-bauer?src=longreads\" target=\"_blank\">1. My Four Months as a Private Prison Guard<\/a><\/h2>\n<p class=\"top5-credit\"><em>Shane Bauer&nbsp;| Mother Jones&nbsp;| June 23, 2016 | 145&nbsp;minutes (36,384&nbsp;words)<\/em><\/p>\n<p>Bauer goes undercover as a private prison guard to investigate the inner workings of a for-profit prison in Winnfield, Louisiana run by the Corrections Corporation of America. He witnesses multiple stabbings, prisoners denied adequate care, and becomes unsettled by the way the job changes his behavior.<\/p>\n<h2 class=\"top5-title\"><a href=\"https:\/\/newrepublic.com\/article\/133890\/ghosts-fukushima?src=longreads\" target=\"_blank\">2. The Ghosts of Fukushima<\/a><\/h2>\n<p class=\"top5-credit\"><em>Steve Featherstone | The New Republic&nbsp;| June 20, 2016 | 20&nbsp;minutes (4,539&nbsp;words)<\/em><\/p>\n<p>Five years after a massive earthquake and tsunami triggered a meltdown at the Fukushima Daiichi nuclear power plant, only a small percentage of evacuees have returned to the Japanese town of Naraha, which the government has deemed safe following an expensive cleanup effort.<\/p>\n<h2 class=\"top5-title\"><a href=\"http:\/\/lithub.com\/the-dark-side-of-longform-journalism\/?src=longreads\" target=\"_blank\">3. The Dark Side Of Longform Journalism<\/a><\/h2>\n<p class=\"top5-credit\"><em>Luke Mogelson | Literary Hub | June 16, 2016 | 9&nbsp;minutes (2,208&nbsp;words)<\/em><\/p>\n<p>&quot;In the field, we are actively, aggressively seeking to see with our own eyes the reality of war, famine, disaster&mdash;and who isn&rsquo;t at least somewhat gratified when he discovers what he&rsquo;s sought, at least somewhat disappointed when he doesn&rsquo;t?&quot;<\/p>\n<h2 class=\"top5-title\"><a href=\"http:\/\/www.nytimes.com\/2016\/06\/26\/magazine\/will-trump-swallow-the-gop-whole.html?src=longreads\" target=\"_blank\">4. Will Trump Swallow the G.O.P. Whole?<\/a><\/h2>\n<p class=\"top5-credit\"><em>Mark Leibovich | New York Times Magazine&nbsp;| June 21, 2016 | 27&nbsp;minutes (6,829&nbsp;words)<\/em><\/p>\n<p>The Republican party is struggling to maintain party unity with Donald Trump as their presumptive presidential nominee. Leibovich talks with RNC chairman&nbsp;Reince Priebus, House speaker Paul Ryan, and&nbsp;other party leaders about their future.<\/p>\n<h2 class=\"top5-title\"><a href=\"http:\/\/velamag.com\/mother-writer-monster-maid\/?src=longreads\" target=\"_blank\">5. Mother, Writer, Monster, Maid<\/a><\/h2>\n<p class=\"top5-credit\"><em>Rufi Thorpe | Vela&nbsp;| June 21, 2016 | 21 minutes (5,306 words)<\/em><\/p>\n<p>Rufi Thorpe reframes the choice between motherhood and making great art. She synthesizes the words of great women authors, their critics, and examples from her own life as a novelist, wife and mother of two young children.<\/p>\n",
            "excerpt": "<p>Our favorite stories of the week as chosen by the Longreads editorial team.<\/p>\n",
            "slug": "the-top-5-longreads-of-the-week-123",
            "guid": "http:\/\/blog.longreads.com\/?p=35521",
            "status": "publish",
            "sticky": false,
            "password": "",
            "parent": false,
            "type": "post",
            "comments_open": false,
            "pings_open": true,
            "likes_enabled": true,
            "sharing_enabled": true,
            "comment_count": 0,
            "like_count": 175,
            "i_like": false,
            "is_reblogged": false,
            "is_following": true,
            "global_ID": "0efc1cb7a510211a0525cbfc019baadf",
            "featured_image": "https:\/\/longreadsblog.files.wordpress.com\/2016\/06\/414_cca1_b-630_0.jpg",
            "post_thumbnail": {
                "ID": 35522,
                "URL": "https:\/\/longreadsblog.files.wordpress.com\/2016\/06\/414_cca1_b-630_0.jpg",
                "guid": "http:\/\/longreadsblog.files.wordpress.com\/2016\/06\/414_cca1_b-630_0.jpg",
                "mime_type": "image\/jpeg",
                "width": 630,
                "height": 420
            },
            "format": "standard",
            "geo": false,
            "menu_order": 0,
            "publicize_URLs": [],
            "tags": {
                "longreads": {
                    "ID": 35328892,
                    "name": "longreads",
                    "slug": "longreads",
                    "description": "",
                    "post_count": 2320,
                    "meta": {
                        "links": {
                            "self": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762\/tags\/slug:longreads",
                            "help": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762\/tags\/slug:longreads\/help",
                            "site": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762"
                        }
                    }
                },
                "reading list": {
                    "ID": 907,
                    "name": "reading list",
                    "slug": "reading-list",
                    "description": "",
                    "post_count": 248,
                    "meta": {
                        "links": {
                            "self": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762\/tags\/slug:reading-list",
                            "help": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762\/tags\/slug:reading-list\/help",
                            "site": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762"
                        }
                    }
                },
                "top 5": {
                    "ID": 46772,
                    "name": "top 5",
                    "slug": "top-5",
                    "description": "",
                    "post_count": 113,
                    "meta": {
                        "links": {
                            "self": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762\/tags\/slug:top-5",
                            "help": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762\/tags\/slug:top-5\/help",
                            "site": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762"
                        }
                    }
                }
            },
            "categories": {
                "Nonfiction": {
                    "ID": 35009777,
                    "name": "Nonfiction",
                    "slug": "nonfiction-2",
                    "description": "",
                    "post_count": 1685,
                    "parent": 0,
                    "meta": {
                        "links": {
                            "self": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762\/categories\/slug:nonfiction-2",
                            "help": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762\/categories\/slug:nonfiction-2\/help",
                            "site": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762"
                        }
                    }
                },
                "Reading List": {
                    "ID": 7814148,
                    "name": "Reading List",
                    "slug": "reading-list-2",
                    "description": "",
                    "post_count": 356,
                    "parent": 0,
                    "meta": {
                        "links": {
                            "self": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762\/categories\/slug:reading-list-2",
                            "help": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762\/categories\/slug:reading-list-2\/help",
                            "site": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762"
                        }
                    }
                },
                "Top 5": {
                    "ID": 35211383,
                    "name": "Top 5",
                    "slug": "top-5-2",
                    "description": "",
                    "post_count": 128,
                    "parent": 0,
                    "meta": {
                        "links": {
                            "self": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762\/categories\/slug:top-5-2",
                            "help": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762\/categories\/slug:top-5-2\/help",
                            "site": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762"
                        }
                    }
                }
            },
            "attachments": {
                "35522": {
                    "ID": 35522,
                    "URL": "https:\/\/longreadsblog.files.wordpress.com\/2016\/06\/414_cca1_b-630_0.jpg",
                    "guid": "http:\/\/longreadsblog.files.wordpress.com\/2016\/06\/414_cca1_b-630_0.jpg",
                    "mime_type": "image\/jpeg",
                    "width": 630,
                    "height": 420
                }
            },
            "metadata": [
                {
                    "id": "140596",
                    "key": "geo_public",
                    "value": "0"
                },
                {
                    "id": "140595",
                    "key": "_thumbnail_id",
                    "value": "35522"
                },
                {
                    "id": "140605",
                    "key": "_wpas_done_8071423",
                    "value": "1"
                },
                {
                    "id": "140612",
                    "key": "_wpas_skip_8071423",
                    "value": "1"
                }
            ],
            "meta": {
                "links": {
                    "self": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762\/posts\/35521",
                    "help": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762\/posts\/35521\/help",
                    "site": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762",
                    "replies": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762\/posts\/35521\/replies\/",
                    "likes": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762\/posts\/35521\/likes\/"
                }
            },
            "current_user_can": {
                "publish_post": false,
                "delete_post": false,
                "edit_post": false
            },
            "capabilities": {
                "publish_post": false,
                "delete_post": false,
                "edit_post": false
            },
            "pseudo_ID": "0efc1cb7a510211a0525cbfc019baadf",
            "is_external": false,
            "site_name": "Longreads Blog",
            "site_URL": "http:\/\/blog.longreads.com",
            "site_is_private": false,
            "featured_media": {
                "uri": "https:\/\/longreadsblog.files.wordpress.com\/2016\/06\/414_cca1_b-630_0.jpg",
                "width": 630,
                "height": 420,
                "type": "image"
            },
            "feed_ID": 22973954
        }
    ]
}