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": "2017-04-28T16:17:07-04:00",
        "after": "2017-04-28T16:17:07-04:00"
    },
    "number": 1,
    "posts": [
        {
            "ID": 69238,
            "site_ID": 70135762,
            "author": {
                "ID": 54109142,
                "login": "hudsongiles",
                "email": false,
                "name": "Matt Giles",
                "first_name": "Matt",
                "last_name": "Giles",
                "nice_name": "hudsongiles",
                "URL": "http:\/\/crashintheglass.wordpress.com",
                "avatar_URL": "https:\/\/1.gravatar.com\/avatar\/4f1b9b134e9bd05e1b448f065dfa1e8e?s=96&d=identicon&r=G",
                "profile_URL": "http:\/\/en.gravatar.com\/hudsongiles",
                "site_ID": 56625039
            },
            "date": "2017-04-28T16:17:07-04:00",
            "modified": "2017-04-28T16:24:27-04:00",
            "title": "Is Butter the Future?",
            "URL": "http:\/\/longreads.com\/2017\/04\/28\/is-butter-the-future\/",
            "short_URL": "http:\/\/wp.me\/p4KhvY-i0K",
            "content": "<p>In the <a href=\"http:\/\/www.elle.com\/beauty\/health-fitness\/a44377\/got-fat-feature\/\">April issue of\u00a0<em>Elle<\/em> magazine<\/a>, Molly Langmuir questions the societal and dietary norms that\u00a0preach ‘fat is bad.’ Langmuir spoke\u00a0with Sally\u00a0Fallon, who, for two decades, has preached \u00a0the health benefits of enjoying animal proteins, organ meats, and raw milk and yogurt (while avoiding all things processed), and reveals that food\u2014like all else\u2014isn’t binary. Enjoying fatty foods doesn’t have to just be a cheat day indulgence.<\/p>\n<blockquote><p>Raised in Palos Verdes, California, by parents she calls “the original foodies,” Fallon got an English degree at Stanford in 1970 and settled in Washington, DC, with her then husband (they later divorced), who worked in the aerospace industry. “I knew in my bones this low-fat thing was wrong,” she said. But she didn’t have evidence until she read <em>Nutrition and Physical Degeneration<\/em>, published in 1939 by an intrepid dentist named Weston A. Price, which documented his world travels studying diets and health. His conclusion? Various diseases, cavities, even “personality disturbances,” were rare among groups who ate like their ancestors\u2014 lots of meats or seafood, plenty of fat, and, if they ate carbs, whole grains\u2014but rampant among those who’d adopted a modern diet, with heaps of white flour and sugar.<\/p>\n<p class=\"p2 body-el-text standard-body-el-text\">Fallon eventually had four kids and fed them foods like liver and raw milk\u2014she credits this with their continued good health and in 1995 she put Price’s beliefs into practical form in the self-published <em>Nourishing Traditions<\/em>. At first, Fallon stored the books in her garage and shipped out a few copies a month, but “it started to grow and grow,” she said. Even Atkins blurbed her book, gushing that the first chapter “is so right on target that I feel a little guilty for taking her ideas.” There are now 740,000 copies in print.<\/p>\n<p class=\"p2 body-el-text standard-body-el-text\">Over lunch\u2014a tomato soup into which she’d stirred an entire container of cr\u00e8me fra\u00eeche and a dip made from cheese, butter, and cream\u2014she said that at her farm, she does things “the old-fashioned way,” meaning it’s a multispecies realm with pigs that eat the leftover whey, cows that eat the grass, chickens that eat anything they scratch out of the ground, and cats that eat the mice. The living-history\u2013museum vibe carries over into the 150-year-old main house, a precisely decorated three-story affair filled with antique china and Oriental rugs. (There are a few incongruous nods to the present: a swimming pool, a wine fridge.) Fallon does her writing at an enormous antique desk, on which sits a glass paperweight I mistook for a crystal ball. “I don’t see the future,” she said. Then she laughed. “Yes, I do! And it’s butter!”<\/p>\n<\/blockquote>\n<p><a class=\"button-red\" href=\"http:\/\/www.elle.com\/beauty\/health-fitness\/a44377\/got-fat-feature\/\">Read the story<\/a><\/p>\n",
            "excerpt": "<p>Why you should enjoy\u2014guilt free\u2014that blue cheese-topped burger.<\/p>\n",
            "slug": "is-butter-the-future",
            "guid": "http:\/\/longreads.com\/?p=69238",
            "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": 199,
            "i_like": false,
            "is_reblogged": false,
            "is_following": true,
            "global_ID": "bc852f0f6f2d3b1a77ddef7909e679a8",
            "featured_image": "https:\/\/longreadsblog.files.wordpress.com\/2017\/04\/ap_17066809536774.jpg",
            "post_thumbnail": {
                "ID": 69244,
                "URL": "https:\/\/longreadsblog.files.wordpress.com\/2017\/04\/ap_17066809536774.jpg",
                "guid": "http:\/\/longreadsblog.files.wordpress.com\/2017\/04\/ap_17066809536774.jpg",
                "mime_type": "image\/jpeg",
                "width": 3600,
                "height": 2400
            },
            "format": "standard",
            "geo": false,
            "menu_order": 0,
            "publicize_URLs": [],
            "tags": {
                "animal fats": {
                    "ID": 1758340,
                    "name": "animal fats",
                    "slug": "animal-fats",
                    "description": "",
                    "post_count": 1,
                    "meta": {
                        "links": {
                            "self": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762\/tags\/slug:animal-fats",
                            "help": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762\/tags\/slug:animal-fats\/help",
                            "site": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762"
                        }
                    }
                },
                "animal proteins": {
                    "ID": 3902865,
                    "name": "animal proteins",
                    "slug": "animal-proteins",
                    "description": "",
                    "post_count": 1,
                    "meta": {
                        "links": {
                            "self": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762\/tags\/slug:animal-proteins",
                            "help": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762\/tags\/slug:animal-proteins\/help",
                            "site": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762"
                        }
                    }
                },
                "Atkins Diet": {
                    "ID": 136730,
                    "name": "Atkins Diet",
                    "slug": "atkins-diet",
                    "description": "",
                    "post_count": 1,
                    "meta": {
                        "links": {
                            "self": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762\/tags\/slug:atkins-diet",
                            "help": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762\/tags\/slug:atkins-diet\/help",
                            "site": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762"
                        }
                    }
                },
                "Butter": {
                    "ID": 160879,
                    "name": "Butter",
                    "slug": "butter",
                    "description": "",
                    "post_count": 3,
                    "meta": {
                        "links": {
                            "self": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762\/tags\/slug:butter",
                            "help": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762\/tags\/slug:butter\/help",
                            "site": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762"
                        }
                    }
                },
                "fatty food": {
                    "ID": 2823644,
                    "name": "fatty food",
                    "slug": "fatty-food",
                    "description": "",
                    "post_count": 1,
                    "meta": {
                        "links": {
                            "self": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762\/tags\/slug:fatty-food",
                            "help": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762\/tags\/slug:fatty-food\/help",
                            "site": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762"
                        }
                    }
                },
                "Mary Fallon": {
                    "ID": 6374602,
                    "name": "Mary Fallon",
                    "slug": "mary-fallon",
                    "description": "",
                    "post_count": 1,
                    "meta": {
                        "links": {
                            "self": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762\/tags\/slug:mary-fallon",
                            "help": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762\/tags\/slug:mary-fallon\/help",
                            "site": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762"
                        }
                    }
                }
            },
            "categories": {
                "Nonfiction": {
                    "ID": 35009777,
                    "name": "Nonfiction",
                    "slug": "nonfiction-2",
                    "description": "",
                    "post_count": 2300,
                    "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"
                        }
                    }
                },
                "Quotes": {
                    "ID": 28016040,
                    "name": "Quotes",
                    "slug": "quotes-2",
                    "description": "",
                    "post_count": 1574,
                    "parent": 0,
                    "meta": {
                        "links": {
                            "self": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762\/categories\/slug:quotes-2",
                            "help": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762\/categories\/slug:quotes-2\/help",
                            "site": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762"
                        }
                    }
                },
                "Uncategorized": {
                    "ID": 1,
                    "name": "Uncategorized",
                    "slug": "uncategorized",
                    "description": "",
                    "post_count": 1909,
                    "parent": 0,
                    "meta": {
                        "links": {
                            "self": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762\/categories\/slug:uncategorized",
                            "help": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762\/categories\/slug:uncategorized\/help",
                            "site": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762"
                        }
                    }
                }
            },
            "attachments": {
                "69244": {
                    "ID": 69244,
                    "URL": "https:\/\/longreadsblog.files.wordpress.com\/2017\/04\/ap_17066809536774.jpg",
                    "guid": "http:\/\/longreadsblog.files.wordpress.com\/2017\/04\/ap_17066809536774.jpg",
                    "mime_type": "image\/jpeg",
                    "width": 3600,
                    "height": 2400
                }
            },
            "metadata": [
                {
                    "id": "363809",
                    "key": "geo_public",
                    "value": "0"
                },
                {
                    "id": "363822",
                    "key": "_thumbnail_id",
                    "value": "69244"
                }
            ],
            "meta": {
                "links": {
                    "self": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762\/posts\/69238",
                    "help": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762\/posts\/69238\/help",
                    "site": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762",
                    "replies": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762\/posts\/69238\/replies\/",
                    "likes": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/70135762\/posts\/69238\/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": "bc852f0f6f2d3b1a77ddef7909e679a8",
            "is_external": false,
            "site_name": "Longreads",
            "site_URL": "http:\/\/longreads.com",
            "site_is_private": false,
            "featured_media": {
                "uri": "https:\/\/longreadsblog.files.wordpress.com\/2017\/04\/ap_17066809536774.jpg",
                "width": 3600,
                "height": 2400,
                "type": "image"
            },
            "feed_ID": 22973954
        }
    ]
}