GET /me/sites

Get a list of the current user's sites.

Resource Information

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

Query Parameters

Parameter Type Description
context (string)
display:
(default) Formats the output as HTML for display. Shortcodes are parsed, paragraph tags are added, etc..
edit:
Formats the output for editing. Shortcodes are left unparsed, significant whitespace is kept, etc..
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.
site_visibility (string)
all:
(default) Return all sites user is a member of, both visible and hidden.
visible:
Only return sites set to visible for the user.
hidden:
Only return sites set to hidden for the user.
options (string) Optional. Returns specified options only. Comma-separated list. Example: options=login_url,timezone
include_domain_only (bool) Optional. Whether to include domain-only sites
site_activity (string)
all:
(default) Return all sites both active or inactive.
active:
Only return active sites.
inactive:
Only return inactive sites.

Response Parameters

Parameter Type Description
sites (array) List of sites.

Resource Errors

These are the possible errors returned by this endpoint.

HTTP Code Error Identifier Error Message
403 unauthorized User cannot access this blog
403 unauthorized User cannot access this private blog.
403 unauthorized User cannot access this restricted blog
403 authorization_required An active access token must be used to query information about the current user.
400 invalid_input Invalid request input
403 authorization_required An active access token must be used to query information about the current blog.

Example

curl \
 -H 'authorization: Bearer YOUR_API_TOKEN' \
 'https://public-api.wordpress.com/rest/v1.1/me/sites'
<?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.1/me/sites',
	false,
	$context
);
$response = json_decode( $response );
?>

Response

{
    "sites": [
        {
            "ID": 82974409,
            "name": "API Examples",
            "description": "Examples for you to build your app from.",
            "URL": "https:\/\/apiexamples.wordpress.com",
            "user_can_manage": false,
            "capabilities": {
                "edit_pages": true,
                "edit_posts": true,
                "edit_others_posts": true,
                "edit_others_pages": true,
                "delete_posts": true,
                "delete_others_posts": true,
                "edit_theme_options": true,
                "edit_users": false,
                "list_users": true,
                "manage_categories": true,
                "manage_options": true,
                "moderate_comments": true,
                "activate_wordads": true,
                "promote_users": true,
                "publish_posts": true,
                "upload_files": true,
                "delete_users": false,
                "remove_users": true,
                "view_stats": true
            },
            "jetpack": false,
            "is_multisite": true,
            "post_count": 9,
            "subscribers_count": 1,
            "lang": "en",
            "logo": {
                "id": 0,
                "sizes": [],
                "url": ""
            },
            "visible": true,
            "is_private": false,
            "single_user_site": true,
            "is_vip": false,
            "is_following": true,
            "options": {
                "timezone": "",
                "gmt_offset": 0,
                "blog_public": 1,
                "videopress_enabled": false,
                "upgraded_filetypes_enabled": false,
                "login_url": "https:\/\/apiexamples.wordpress.com\/wp-login.php",
                "admin_url": "https:\/\/apiexamples.wordpress.com\/wp-admin\/",
                "is_mapped_domain": false,
                "is_redirect": false,
                "unmapped_url": "https:\/\/apiexamples.wordpress.com",
                "featured_images_enabled": false,
                "theme_slug": "pub\/chateau",
                "header_image": false,
                "background_color": false,
                "image_default_link_type": "file",
                "image_thumbnail_width": 150,
                "image_thumbnail_height": 150,
                "image_thumbnail_crop": 0,
                "image_medium_width": 300,
                "image_medium_height": 300,
                "image_large_width": 1024,
                "image_large_height": 1024,
                "permalink_structure": "\/%year%\/%monthnum%\/%day%\/%postname%\/",
                "post_formats": [],
                "default_post_format": "0",
                "default_category": 1,
                "allowed_file_types": [
                    "jpg",
                    "jpeg",
                    "png",
                    "gif",
                    "pdf",
                    "doc",
                    "ppt",
                    "odt",
                    "pptx",
                    "docx",
                    "pps",
                    "ppsx",
                    "xls",
                    "xlsx",
                    "key",
                    "asc"
                ],
                "show_on_front": "posts",
                "default_likes_enabled": true,
                "default_sharing_status": true,
                "default_comment_status": true,
                "default_ping_status": true,
                "software_version": "5.2.2",
                "created_at": "2015-01-15T06:56:07+00:00",
                "wordads": false,
                "publicize_permanently_disabled": false,
                "frame_nonce": "286f629553",
                "jetpack_frame_nonce": "286f629553",
                "headstart": false,
                "headstart_is_fresh": false,
                "ak_vp_bundle_enabled": null,
                "advanced_seo_front_page_description": "",
                "advanced_seo_title_formats": [],
                "verification_services_codes": null,
                "podcasting_archive": null,
                "is_domain_only": false,
                "is_automated_transfer": false,
                "is_wpcom_atomic": false,
                "is_wpcom_store": false,
                "woocommerce_is_active": false,
                "design_type": null,
                "site_goals": null,
                "site_segment": null
            },
            "plan": {
                "product_id": 1,
                "product_slug": "free_plan",
                "product_name": "WordPress.com Free",
                "product_name_short": "Free",
                "expired": false,
                "user_is_owner": false,
                "is_free": true,
                "features": {
                    "active": [
                        "free-blog",
                        "space",
                        "support"
                    ],
                    "available": {
                        "free-blog": [
                            "personal-bundle",
                            "value_bundle",
                            "business-bundle",
                            "ecommerce-bundle",
                            "personal-bundle-2y",
                            "value_bundle-2y",
                            "business-bundle-2y",
                            "blogger-bundle",
                            "blogger-bundle-2y",
                            "ecommerce-bundle",
                            "ecommerce-bundle-2y"
                        ],
                        "custom-domain": [
                            "personal-bundle",
                            "value_bundle",
                            "business-bundle",
                            "ecommerce-bundle",
                            "personal-bundle-2y",
                            "value_bundle-2y",
                            "business-bundle-2y",
                            "blogger-bundle",
                            "blogger-bundle-2y",
                            "ecommerce-bundle",
                            "ecommerce-bundle-2y"
                        ],
                        "space": [
                            "personal-bundle",
                            "value_bundle",
                            "business-bundle",
                            "ecommerce-bundle",
                            "personal-bundle-2y",
                            "value_bundle-2y",
                            "business-bundle-2y",
                            "blogger-bundle",
                            "blogger-bundle-2y",
                            "ecommerce-bundle",
                            "ecommerce-bundle-2y"
                        ],
                        "support": [
                            "personal-bundle",
                            "value_bundle",
                            "business-bundle",
                            "ecommerce-bundle",
                            "personal-bundle-2y",
                            "value_bundle-2y",
                            "business-bundle-2y",
                            "blogger-bundle",
                            "blogger-bundle-2y",
                            "ecommerce-bundle",
                            "ecommerce-bundle-2y"
                        ],
                        "no-adverts\/no-adverts.php": [
                            "value_bundle",
                            "business-bundle",
                            "ecommerce-bundle",
                            "value_bundle-2y",
                            "business-bundle-2y",
                            "ecommerce-bundle",
                            "ecommerce-bundle-2y"
                        ],
                        "custom-design": [
                            "value_bundle",
                            "business-bundle",
                            "ecommerce-bundle",
                            "value_bundle-2y",
                            "business-bundle-2y",
                            "ecommerce-bundle",
                            "ecommerce-bundle-2y"
                        ],
                        "videopress": [
                            "value_bundle",
                            "business-bundle",
                            "ecommerce-bundle",
                            "value_bundle-2y",
                            "business-bundle-2y",
                            "ecommerce-bundle",
                            "ecommerce-bundle-2y"
                        ],
                        "unlimited_themes": [
                            "value_bundle",
                            "business-bundle",
                            "ecommerce-bundle",
                            "value_bundle-2y",
                            "business-bundle-2y",
                            "ecommerce-bundle",
                            "ecommerce-bundle-2y"
                        ],
                        "live_support": [
                            "value_bundle",
                            "business-bundle",
                            "ecommerce-bundle",
                            "value_bundle-2y",
                            "business-bundle-2y",
                            "ecommerce-bundle",
                            "ecommerce-bundle-2y"
                        ],
                        "simple-payments": [
                            "value_bundle",
                            "business-bundle",
                            "ecommerce-bundle",
                            "value_bundle-2y",
                            "business-bundle-2y",
                            "ecommerce-bundle",
                            "ecommerce-bundle-2y"
                        ],
                        "premium-themes": [
                            "business-bundle",
                            "ecommerce-bundle",
                            "business-bundle-2y",
                            "ecommerce-bundle",
                            "ecommerce-bundle-2y"
                        ],
                        "google-analytics": [
                            "business-bundle",
                            "ecommerce-bundle",
                            "business-bundle-2y",
                            "ecommerce-bundle",
                            "ecommerce-bundle-2y"
                        ]
                    }
                }
            },
            "jetpack_modules": null,
            "meta": {
                "links": {
                    "self": "https:\/\/public-api.wordpress.com\/rest\/v1.1\/sites\/82974409",
                    "help": "https:\/\/public-api.wordpress.com\/rest\/v1.1\/sites\/82974409\/help",
                    "posts": "https:\/\/public-api.wordpress.com\/rest\/v1.1\/sites\/82974409\/posts\/",
                    "comments": "https:\/\/public-api.wordpress.com\/rest\/v1.1\/sites\/82974409\/comments\/",
                    "xmlrpc": "https:\/\/apiexamples.wordpress.com\/xmlrpc.php"
                }
            },
            "quota": {
                "space_allowed": 3221225472,
                "space_used": 85506175,
                "percent_used": 2.654461034884055,
                "space_available": 3135719297
            },
            "launch_status": false
        },
        {
            "ID": 89681062,
            "name": "API Examples 2",
            "description": "",
            "URL": "https:\/\/apiexamples2.wordpress.com",
            "user_can_manage": false,
            "capabilities": {
                "edit_pages": true,
                "edit_posts": true,
                "edit_others_posts": true,
                "edit_others_pages": true,
                "delete_posts": true,
                "delete_others_posts": true,
                "edit_theme_options": true,
                "edit_users": false,
                "list_users": true,
                "manage_categories": true,
                "manage_options": true,
                "moderate_comments": true,
                "activate_wordads": true,
                "promote_users": true,
                "publish_posts": true,
                "upload_files": true,
                "delete_users": false,
                "remove_users": true,
                "view_stats": true
            },
            "jetpack": false,
            "is_multisite": true,
            "post_count": 0,
            "subscribers_count": 0,
            "lang": "en",
            "logo": {
                "id": 0,
                "sizes": [],
                "url": ""
            },
            "visible": true,
            "is_private": false,
            "single_user_site": true,
            "is_vip": false,
            "is_following": false,
            "options": {
                "timezone": "",
                "gmt_offset": 0,
                "blog_public": 1,
                "videopress_enabled": false,
                "upgraded_filetypes_enabled": false,
                "login_url": "https:\/\/apiexamples2.wordpress.com\/wp-login.php",
                "admin_url": "https:\/\/apiexamples2.wordpress.com\/wp-admin\/",
                "is_mapped_domain": false,
                "is_redirect": false,
                "unmapped_url": "https:\/\/apiexamples2.wordpress.com",
                "featured_images_enabled": false,
                "theme_slug": "pub\/twentytwelve",
                "header_image": false,
                "background_color": false,
                "image_default_link_type": "file",
                "image_thumbnail_width": 150,
                "image_thumbnail_height": 150,
                "image_thumbnail_crop": 0,
                "image_medium_width": 300,
                "image_medium_height": 300,
                "image_large_width": 1024,
                "image_large_height": 1024,
                "permalink_structure": "\/%year%\/%monthnum%\/%day%\/%postname%\/",
                "post_formats": [],
                "default_post_format": "0",
                "default_category": 1,
                "allowed_file_types": [
                    "jpg",
                    "jpeg",
                    "png",
                    "gif",
                    "pdf",
                    "doc",
                    "ppt",
                    "odt",
                    "pptx",
                    "docx",
                    "pps",
                    "ppsx",
                    "xls",
                    "xlsx",
                    "key",
                    "asc"
                ],
                "show_on_front": "posts",
                "default_likes_enabled": true,
                "default_sharing_status": true,
                "default_comment_status": true,
                "default_ping_status": true,
                "software_version": "5.2.2",
                "created_at": "2015-04-19T15:39:00+00:00",
                "wordads": false,
                "publicize_permanently_disabled": false,
                "frame_nonce": "5ad3cd47ab",
                "jetpack_frame_nonce": "5ad3cd47ab",
                "headstart": false,
                "headstart_is_fresh": false,
                "ak_vp_bundle_enabled": null,
                "advanced_seo_front_page_description": "",
                "advanced_seo_title_formats": [],
                "verification_services_codes": null,
                "podcasting_archive": null,
                "is_domain_only": false,
                "is_automated_transfer": false,
                "is_wpcom_atomic": false,
                "is_wpcom_store": false,
                "woocommerce_is_active": false,
                "design_type": null,
                "site_goals": null,
                "site_segment": null
            },
            "plan": {
                "product_id": 1,
                "product_slug": "free_plan",
                "product_name": "WordPress.com Free",
                "product_name_short": "Free",
                "expired": false,
                "user_is_owner": false,
                "is_free": true,
                "features": {
                    "active": [
                        "free-blog",
                        "space",
                        "support"
                    ],
                    "available": {
                        "free-blog": [
                            "personal-bundle",
                            "value_bundle",
                            "business-bundle",
                            "ecommerce-bundle",
                            "personal-bundle-2y",
                            "value_bundle-2y",
                            "business-bundle-2y",
                            "blogger-bundle",
                            "blogger-bundle-2y",
                            "ecommerce-bundle",
                            "ecommerce-bundle-2y"
                        ],
                        "custom-domain": [
                            "personal-bundle",
                            "value_bundle",
                            "business-bundle",
                            "ecommerce-bundle",
                            "personal-bundle-2y",
                            "value_bundle-2y",
                            "business-bundle-2y",
                            "blogger-bundle",
                            "blogger-bundle-2y",
                            "ecommerce-bundle",
                            "ecommerce-bundle-2y"
                        ],
                        "space": [
                            "personal-bundle",
                            "value_bundle",
                            "business-bundle",
                            "ecommerce-bundle",
                            "personal-bundle-2y",
                            "value_bundle-2y",
                            "business-bundle-2y",
                            "blogger-bundle",
                            "blogger-bundle-2y",
                            "ecommerce-bundle",
                            "ecommerce-bundle-2y"
                        ],
                        "support": [
                            "personal-bundle",
                            "value_bundle",
                            "business-bundle",
                            "ecommerce-bundle",
                            "personal-bundle-2y",
                            "value_bundle-2y",
                            "business-bundle-2y",
                            "blogger-bundle",
                            "blogger-bundle-2y",
                            "ecommerce-bundle",
                            "ecommerce-bundle-2y"
                        ],
                        "no-adverts\/no-adverts.php": [
                            "value_bundle",
                            "business-bundle",
                            "ecommerce-bundle",
                            "value_bundle-2y",
                            "business-bundle-2y",
                            "ecommerce-bundle",
                            "ecommerce-bundle-2y"
                        ],
                        "custom-design": [
                            "value_bundle",
                            "business-bundle",
                            "ecommerce-bundle",
                            "value_bundle-2y",
                            "business-bundle-2y",
                            "ecommerce-bundle",
                            "ecommerce-bundle-2y"
                        ],
                        "videopress": [
                            "value_bundle",
                            "business-bundle",
                            "ecommerce-bundle",
                            "value_bundle-2y",
                            "business-bundle-2y",
                            "ecommerce-bundle",
                            "ecommerce-bundle-2y"
                        ],
                        "unlimited_themes": [
                            "value_bundle",
                            "business-bundle",
                            "ecommerce-bundle",
                            "value_bundle-2y",
                            "business-bundle-2y",
                            "ecommerce-bundle",
                            "ecommerce-bundle-2y"
                        ],
                        "live_support": [
                            "value_bundle",
                            "business-bundle",
                            "ecommerce-bundle",
                            "value_bundle-2y",
                            "business-bundle-2y",
                            "ecommerce-bundle",
                            "ecommerce-bundle-2y"
                        ],
                        "simple-payments": [
                            "value_bundle",
                            "business-bundle",
                            "ecommerce-bundle",
                            "value_bundle-2y",
                            "business-bundle-2y",
                            "ecommerce-bundle",
                            "ecommerce-bundle-2y"
                        ],
                        "premium-themes": [
                            "business-bundle",
                            "ecommerce-bundle",
                            "business-bundle-2y",
                            "ecommerce-bundle",
                            "ecommerce-bundle-2y"
                        ],
                        "google-analytics": [
                            "business-bundle",
                            "ecommerce-bundle",
                            "business-bundle-2y",
                            "ecommerce-bundle",
                            "ecommerce-bundle-2y"
                        ]
                    }
                }
            },
            "jetpack_modules": null,
            "meta": {
                "links": {
                    "self": "https:\/\/public-api.wordpress.com\/rest\/v1.1\/sites\/89681062",
                    "help": "https:\/\/public-api.wordpress.com\/rest\/v1.1\/sites\/89681062\/help",
                    "posts": "https:\/\/public-api.wordpress.com\/rest\/v1.1\/sites\/89681062\/posts\/",
                    "comments": "https:\/\/public-api.wordpress.com\/rest\/v1.1\/sites\/89681062\/comments\/",
                    "xmlrpc": "https:\/\/apiexamples2.wordpress.com\/xmlrpc.php"
                }
            },
            "quota": {
                "space_allowed": 3221225472,
                "space_used": 0,
                "percent_used": 0,
                "space_available": 3221225472
            },
            "launch_status": false
        }
    ]
}