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": "2018-04-23T17:00:54+00:00",
        "after": "2018-04-23T17:00:54+00:00"
    },
    "number": 1,
    "posts": [
        {
            "ID": 40309,
            "site_ID": 3584907,
            "author": {
                "ID": 2088739,
                "login": "sergioestevao",
                "email": false,
                "name": "S\u00e9rgio Est\u00eav\u00e3o",
                "first_name": "S\u00e9rgio",
                "last_name": "Est\u00eav\u00e3o",
                "nice_name": "sergioestevao",
                "URL": "http:\/\/sergioestevao.com",
                "avatar_URL": "https:\/\/1.gravatar.com\/avatar\/d52be03aa7910a80c89d6d92181a8d02?s=96&d=retro",
                "profile_URL": "https:\/\/en.gravatar.com\/sergioestevao",
                "ip_address": false,
                "site_ID": 71079244,
                "site_visible": true
            },
            "date": "2018-04-23T17:00:54+00:00",
            "modified": "2018-04-23T17:07:37+00:00",
            "title": "Background Post and Media Uploading with WordPress for iOS 9.8",
            "URL": "http:\/\/en.blog.wordpress.com\/2018\/04\/23\/ios-nine-point-eight\/",
            "short_URL": "https:\/\/wp.me\/pf2B5-au9",
            "content": "<p>Version 9.8 of WordPress for iOS rolls out this week, and includes some great enhancements to publishing: background media and post uploading.<\/p>\n<p>Adding images to a post or page? Now, you can publish \u2014 and accomplish other tasks \u2014 while your media uploads. No more waiting inside the editor while images gradually upload! Tap the Publish button and the app takes care of uploading and publishing, leaving you free to leave the post editor and get on with other things.<\/p>\n<p>You can do the same thing while saving drafts. And yes, you can have multiple posts uploading media in the background concurrently.<\/p>\n<p>We\u2019ve also spruced up the interface, and added notifications so that you always know the status of your posts and uploads. Visit your post list at any time for a progress report on all your uploads.<\/p>\n<p>You can even leave the app and the upload will continue in the background while you check other things on your device.<\/p>\n<p>Here is a video of the new functionality:<\/p>\n<p><\/iframe><script src='https:\/\/v0.wordpress.com\/js\/next\/videopress-iframe.js?m=1435166243'><\/script><\/p>\n<p><b>Give feedback and get involved<\/b><\/p>\n<p>Download WordPress for iOS on the <a href=\"https:\/\/search.itunes.apple.com\/WebObjects\/MZContentLink.woa\/wa\/link?mt=8&amp;path=apps%2fWordPress\">App Store<\/a>. We\u2019ll be rolling out the update over the course of the week, so it may be a couple of days before you see the update on your device. You can always manually check for an update by searching \u201cWordPress\u201d in the App Store if you just can\u2019t wait<\/p>\n<p>Do you have feedback on the app? <a href=\"https:\/\/apps.wordpress.com\/contribute\/\">Please share it!<\/a> \u00a0If you\u2019re a developer and would like to contribute to the project, here\u2019s more information on how <a href=\"https:\/\/apps.wordpress.com\/contribute\/\">you can get involved<\/a>.<\/p>\n",
            "excerpt": "<p>Upload images and media in the background with WordPress for iOS 9.8<\/p>\n",
            "slug": "ios-nine-point-eight",
            "guid": "http:\/\/en.blog.wordpress.com\/?p=40309",
            "status": "publish",
            "sticky": false,
            "password": "",
            "parent": false,
            "type": "post",
            "comments_open": true,
            "pings_open": false,
            "likes_enabled": true,
            "sharing_enabled": true,
            "comment_count": 0,
            "like_count": 463,
            "i_like": false,
            "is_reblogged": false,
            "is_following": true,
            "global_ID": "007699596d41b78d8cf0da907c641786",
            "featured_image": "https:\/\/en-blog.files.wordpress.com\/2018\/04\/asyncupload4.jpg",
            "post_thumbnail": {
                "ID": 40326,
                "URL": "https:\/\/en-blog.files.wordpress.com\/2018\/04\/asyncupload4.jpg",
                "guid": "http:\/\/en.blog.files.wordpress.com\/2018\/04\/asyncupload4.jpg",
                "mime_type": "image\/jpeg",
                "width": 12374,
                "height": 5292
            },
            "format": "standard",
            "geo": false,
            "menu_order": 0,
            "publicize_URLs": [],
            "tags": {
                "WordPress for iOS": {
                    "ID": 39254936,
                    "name": "WordPress for iOS",
                    "slug": "wordpress-for-ios",
                    "description": "",
                    "post_count": 11,
                    "meta": {
                        "links": {
                            "self": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/3584907\/tags\/slug:wordpress-for-ios",
                            "help": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/3584907\/tags\/slug:wordpress-for-ios\/help",
                            "site": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/3584907"
                        }
                    }
                }
            },
            "categories": {
                "Applications": {
                    "ID": 357,
                    "name": "Applications",
                    "slug": "applications",
                    "description": "",
                    "post_count": 10,
                    "parent": 0,
                    "meta": {
                        "links": {
                            "self": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/3584907\/categories\/slug:applications",
                            "help": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/3584907\/categories\/slug:applications\/help",
                            "site": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/3584907"
                        }
                    }
                },
                "Editing": {
                    "ID": 11746,
                    "name": "Editing",
                    "slug": "editing",
                    "description": "",
                    "post_count": 7,
                    "parent": 0,
                    "meta": {
                        "links": {
                            "self": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/3584907\/categories\/slug:editing",
                            "help": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/3584907\/categories\/slug:editing\/help",
                            "site": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/3584907"
                        }
                    }
                },
                "Features": {
                    "ID": 9548,
                    "name": "Features",
                    "slug": "features",
                    "description": "",
                    "post_count": 179,
                    "parent": 0,
                    "meta": {
                        "links": {
                            "self": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/3584907\/categories\/slug:features",
                            "help": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/3584907\/categories\/slug:features\/help",
                            "site": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/3584907"
                        }
                    }
                },
                "Photos": {
                    "ID": 4653804,
                    "name": "Photos",
                    "slug": "photos-2",
                    "description": "",
                    "post_count": 27,
                    "parent": 0,
                    "meta": {
                        "links": {
                            "self": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/3584907\/categories\/slug:photos-2",
                            "help": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/3584907\/categories\/slug:photos-2\/help",
                            "site": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/3584907"
                        }
                    }
                }
            },
            "attachments": {
                "40326": {
                    "ID": 40326,
                    "URL": "https:\/\/en-blog.files.wordpress.com\/2018\/04\/asyncupload4.jpg",
                    "guid": "http:\/\/en.blog.files.wordpress.com\/2018\/04\/asyncupload4.jpg",
                    "mime_type": "image\/jpeg",
                    "width": 12374,
                    "height": 5292
                },
                "40325": {
                    "ID": 40325,
                    "URL": "https:\/\/en-blog.files.wordpress.com\/2018\/04\/asyncupload3.jpg",
                    "guid": "http:\/\/en.blog.files.wordpress.com\/2018\/04\/asyncupload3.jpg",
                    "mime_type": "image\/jpeg",
                    "width": 12374,
                    "height": 5292
                }
            },
            "metadata": [
                {
                    "id": "67826",
                    "key": "geo_public",
                    "value": "0"
                },
                {
                    "id": "67834",
                    "key": "_thumbnail_id",
                    "value": "40326"
                },
                {
                    "id": "67875",
                    "key": "_wpas_done_6699487",
                    "value": "1"
                },
                {
                    "id": "67872",
                    "key": "_wpas_done_9577882",
                    "value": "1"
                },
                {
                    "id": "67827",
                    "key": "_wpas_mess",
                    "value": "Upload media to your posts in the background with WordPress for iOS 9.8:"
                },
                {
                    "id": "67881",
                    "key": "_wpas_skip_6699487",
                    "value": "1"
                },
                {
                    "id": "67880",
                    "key": "_wpas_skip_9577882",
                    "value": "1"
                }
            ],
            "meta": {
                "links": {
                    "self": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/3584907\/posts\/40309",
                    "help": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/3584907\/posts\/40309\/help",
                    "site": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/3584907",
                    "replies": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/3584907\/posts\/40309\/replies\/",
                    "likes": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/3584907\/posts\/40309\/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": "007699596d41b78d8cf0da907c641786",
            "is_external": false,
            "site_name": "The WordPress.com Blog",
            "site_URL": "http:\/\/en.blog.wordpress.com",
            "site_is_private": false,
            "featured_media": {
                "uri": "https:\/\/en-blog.files.wordpress.com\/2018\/04\/asyncupload4.jpg",
                "width": 12374,
                "height": 5292,
                "type": "image"
            },
            "feed_ID": 25823
        }
    ]
}