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": "2019-12-18T18:48:51+00:00",
        "after": "2019-12-10T21:22:15+00:00"
    },
    "number": 2,
    "posts": [
        {
            "ID": 41752,
            "site_ID": 3584907,
            "author": {
                "ID": 22946279,
                "login": "crazywickedawesome",
                "email": false,
                "name": "Ian M.",
                "first_name": "Ian",
                "last_name": "M.",
                "nice_name": "crazywickedawesome",
                "URL": "https:\/\/ian.photos",
                "avatar_URL": "https:\/\/0.gravatar.com\/avatar\/f1354167b52a2832a4aa0b0810376df8?s=96&d=retro",
                "profile_URL": "https:\/\/en.gravatar.com\/crazywickedawesome",
                "ip_address": false,
                "site_ID": 157706485,
                "site_visible": true
            },
            "date": "2019-12-18T18:48:51+00:00",
            "modified": "2019-12-20T11:14:40+00:00",
            "title": "Power Users Rejoice: You've Got SFTP and Database Access",
            "URL": "http:\/\/en.blog.wordpress.com\/2019\/12\/18\/power-users-rejoice-youve-got-sftp-and-database-access\/",
            "short_URL": "https:\/\/wp.me\/pf2B5-aRq",
            "content": "\n<p>Three new hosting management tools give you direct access to your site’s files and data.<\/p>\n\n\n\n<p>Have a site on a Business or eCommerce plan? Now you have three new ways to customize your WordPress.com site: SFTP access, database access, and PHP version switching give you behind-the-scenes access to the nuts and bolts of your site, which means more freedom and flexibility than ever before. If you\u2019ve ever gotten stuck trying to modify your WordPress.com site because you couldn\u2019t manually upload file changes or delete something from your database, website management is about to get a lot easier.<\/p>\n\n\n\n<p>You\u2019ll find all these features in a new section of your dashboard: <strong>Manage &gt; Hosting Configuration<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img src=\"https:\/\/lh5.googleusercontent.com\/tMIFkvscIv18-jq201AXvjpXJiF2uCk2-mX47Kc9njjR9Wdi65JsB-zWaKXgkD-CtGuHFaSzA6MVYqy0FLcwRH-fYZpyGuy1DutfOq9jFZqYHoAP0Iy-uIYtQmPrOXxV5pQlqj4H\" alt=\"\" \/><figcaption>The Hosting Configuration Screen<\/figcaption><\/figure>\n\n\n\n<h1>SFTP credentials<\/h1>\n\n\n\n<p>SFTP is a secure way to access the files and folders on your WordPress.com site using a program on your local computer like Filezilla. Some custom plugins and themes ask you to create specific folders or add files via SFTP. While many of those tasks can be accomplished with tools already built into your WordPress.com dashboard, folks who like using SFTP can now have SFTP access so they can make these changes directly. Check out our <a href=\"https:\/\/en.support.wordpress.com\/sftp\/\">step-by-step guide<\/a> to get started.<\/p>\n\n\n\n<h1>Database access<\/h1>\n\n\n\n<p>At WordPress.com, we regularly optimize your database so you don\u2019t have to, but there might still be times when you need an efficient way to modify data, like purging all the tables created by a plugin you\u2019ve decided to delete. Accessing your site\u2019s database is an effective way to do this.&nbsp;<\/p>\n\n\n\n<p>Database access is a powerful tool, so if you\u2019re at all unsure about working with a database, reach out to our<a href=\"https:\/\/wordpress.com\/help\/contact\"> Happiness Engineers<\/a>! If you\u2019re unfamiliar with databases, you can also find information on getting started in our <a href=\"https:\/\/en.support.wordpress.com\/phpmyadmin-and-mysql\/\">help documentation<\/a>.<\/p>\n\n\n\n<h1>PHP version switching<\/h1>\n\n\n\n<p>PHP is still one of the key languages used to build the web, and a new version, PHP 7.4, was recently released. WordPress.com sites currently run PHP 7.3, which has been tested extensively across all of WordPress.com, but sites on Business or eCommerce plans can switch to version 7.4 immediately. <a href=\"https:\/\/en.blog.wordpress.com\/2019\/11\/28\/php-7-4-just-came-out-and-so-did-our-php-version-switcher\/\">Learn more.<\/a><\/p>\n\n\n\n<p>Since these new tools let you dig into some of the code and data the powers your site, you\u2019ll find a link for our support team right from the dashboard so you can get help if you need it. Have fun getting under the hood, power users!<br><\/p>\n",
            "excerpt": "<p>Three new hosting management tools give you direct access to your site\u2019s files and data.<\/p>\n",
            "slug": "power-users-rejoice-youve-got-sftp-and-database-access",
            "guid": "http:\/\/en.blog.wordpress.com\/?p=41752",
            "status": "publish",
            "sticky": false,
            "password": "",
            "parent": false,
            "type": "post",
            "comments_open": false,
            "pings_open": false,
            "likes_enabled": true,
            "sharing_enabled": true,
            "comment_count": 14,
            "like_count": 742,
            "i_like": false,
            "is_reblogged": false,
            "is_following": true,
            "global_ID": "17231a5d2b6b0fcbc01d5b31054558aa",
            "featured_image": "",
            "post_thumbnail": null,
            "format": "standard",
            "geo": false,
            "menu_order": 0,
            "publicize_URLs": [],
            "tags": {},
            "categories": {
                "Features": {
                    "ID": 9548,
                    "name": "Features",
                    "slug": "features",
                    "description": "",
                    "post_count": 183,
                    "feed_url": "http:\/\/en.blog.wordpress.com\/category\/features\/feed\/",
                    "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"
                        }
                    }
                }
            },
            "attachments": {
                "41757": {
                    "ID": 41757,
                    "URL": "https:\/\/en-blog.files.wordpress.com\/2019\/12\/datavase-access.png",
                    "guid": "http:\/\/en.blog.files.wordpress.com\/2019\/12\/datavase-access.png",
                    "mime_type": "image\/png",
                    "width": 1338,
                    "height": 746
                }
            },
            "metadata": [
                {
                    "id": "71094",
                    "key": "_wpas_done_6699487",
                    "value": "1"
                },
                {
                    "id": "71090",
                    "key": "_wpas_mess",
                    "value": "Power users rejoice: you've got SFTP and database access"
                }
            ],
            "meta": {
                "links": {
                    "self": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/3584907\/posts\/41752",
                    "help": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/3584907\/posts\/41752\/help",
                    "site": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/3584907",
                    "replies": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/3584907\/posts\/41752\/replies\/",
                    "likes": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/3584907\/posts\/41752\/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": "17231a5d2b6b0fcbc01d5b31054558aa",
            "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\/2019\/12\/datavase-access.png",
                "width": 1338,
                "height": 746,
                "type": "image"
            },
            "feed_ID": 25823
        },
        {
            "ID": 41732,
            "site_ID": 3584907,
            "author": {
                "ID": 9912994,
                "login": "danieldudzic",
                "email": false,
                "name": "Danny Dudzic",
                "first_name": "Daniel",
                "last_name": "Dudzic",
                "nice_name": "danieldudzic",
                "URL": "http:\/\/danieldudzic.com",
                "avatar_URL": "https:\/\/2.gravatar.com\/avatar\/bd761dfe050a42c631d3eff0f7295aec?s=96&d=retro",
                "profile_URL": "https:\/\/en.gravatar.com\/danieldudzic",
                "ip_address": false,
                "site_ID": 9624396,
                "site_visible": false
            },
            "date": "2019-12-10T21:22:15+00:00",
            "modified": "2019-12-10T21:22:15+00:00",
            "title": "New Theme: Twenty Twenty",
            "URL": "http:\/\/en.blog.wordpress.com\/2019\/12\/10\/twenty-twenty\/",
            "short_URL": "https:\/\/wp.me\/pf2B5-aR6",
            "content": "\n<p>We\u2019re pleased to announce that <em><a href=\"https:\/\/wordpress.com\/themes\/twentytwenty\">Twenty Twenty<\/a><\/em> \u2014 the new WordPress default theme designed by <a rel=\"noreferrer noopener\" href=\"https:\/\/profiles.wordpress.org\/anlino\/\" target=\"_blank\">Anders Nor\u00e9n<\/a>\u2014 is available to all WordPress.com sites.<\/p>\n\n\n\n<p><em>Twenty Twenty<\/em> was designed with the flexibility of the <a href=\"https:\/\/en.support.wordpress.com\/wordpress-editor\/\">new WordPress Editor<\/a> at its core. If you want to use it for an organization or a business, you can combine columns, groups, and media to create dynamic layouts that show off your services or products. If you want to use it for a traditional blog, the centered content column and considered typography makes it perfect for that as well.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img src=\"https:\/\/en-blog.files.wordpress.com\/2019\/12\/twenty-twenty-short-screenshot.png\" alt=\"\" \/><\/figure>\n\n\n\n<p>It also has been designed and developed to take maximum advantage of the creative freedom enabled by the block editor. Extra care has been given to the Columns and Group blocks, which can be combined into impressive landing pages with intricate blocks layouts. <em>Twenty Twenty<\/em> includes full editor styles for the block editor, so what you see in the editor will almost exactly match the end result. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img src=\"https:\/\/en-blog.files.wordpress.com\/2019\/12\/image-2560.png?w=1024\" alt=\"\" \/><\/figure>\n\n\n\n<p>Learn more about WordPress\u2019s latest default theme&nbsp;<a href=\"https:\/\/wordpress.com\/theme\/twentytwenty\">here<\/a>, or check out the <a href=\"https:\/\/twentytwentydemo.wordpress.com\">demo site<\/a>!<\/p>\n",
            "excerpt": "<p>Meet <em>Twenty Twenty<\/em>, the brand new WordPress default theme.<\/p>\n",
            "slug": "twenty-twenty",
            "guid": "http:\/\/en.blog.wordpress.com\/?p=41732",
            "status": "publish",
            "sticky": false,
            "password": "",
            "parent": false,
            "type": "post",
            "comments_open": false,
            "pings_open": false,
            "likes_enabled": true,
            "sharing_enabled": true,
            "comment_count": 14,
            "like_count": 759,
            "i_like": false,
            "is_reblogged": false,
            "is_following": true,
            "global_ID": "23258bd816a5d9c8e7617f7ce35ed813",
            "featured_image": "https:\/\/en-blog.files.wordpress.com\/2019\/12\/twenty-twenty-screenshot-devices.png",
            "post_thumbnail": {
                "ID": 41733,
                "URL": "https:\/\/en-blog.files.wordpress.com\/2019\/12\/twenty-twenty-screenshot-devices.png",
                "guid": "http:\/\/en.blog.files.wordpress.com\/2019\/12\/twenty-twenty-screenshot-devices.png",
                "mime_type": "image\/png",
                "width": 2048,
                "height": 880
            },
            "format": "standard",
            "geo": false,
            "menu_order": 0,
            "publicize_URLs": [],
            "tags": {},
            "categories": {
                "Themes": {
                    "ID": 540,
                    "name": "Themes",
                    "slug": "themes",
                    "description": "",
                    "post_count": 423,
                    "feed_url": "http:\/\/en.blog.wordpress.com\/category\/themes\/feed\/",
                    "parent": 0,
                    "meta": {
                        "links": {
                            "self": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/3584907\/categories\/slug:themes",
                            "help": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/3584907\/categories\/slug:themes\/help",
                            "site": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/3584907"
                        }
                    }
                }
            },
            "attachments": {
                "41733": {
                    "ID": 41733,
                    "URL": "https:\/\/en-blog.files.wordpress.com\/2019\/12\/twenty-twenty-screenshot-devices.png",
                    "guid": "http:\/\/en.blog.files.wordpress.com\/2019\/12\/twenty-twenty-screenshot-devices.png",
                    "mime_type": "image\/png",
                    "width": 2048,
                    "height": 880
                }
            },
            "metadata": [
                {
                    "id": "71045",
                    "key": "_thumbnail_id",
                    "value": "41733"
                },
                {
                    "id": "71071",
                    "key": "_wpas_done_6699487",
                    "value": "1"
                }
            ],
            "meta": {
                "links": {
                    "self": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/3584907\/posts\/41732",
                    "help": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/3584907\/posts\/41732\/help",
                    "site": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/3584907",
                    "replies": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/3584907\/posts\/41732\/replies\/",
                    "likes": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/3584907\/posts\/41732\/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": "23258bd816a5d9c8e7617f7ce35ed813",
            "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\/2019\/12\/twenty-twenty-screenshot-devices.png",
                "width": 2048,
                "height": 880,
                "type": "image"
            },
            "feed_ID": 25823
        }
    ]
}