GET /me

Get metadata about the current user.

Resource URL

Type URL and Format
GET https://public-api.wordpress.com/rest/v1.1/me

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.

Response Parameters

Parameter Type Description
ID (int) Numeric user ID
display_name (string) The name to display for a user
username (string) Login name of a user
email (string) Email address
primary_blog (int) ID of a user's primary blog
language (string) User language setting
token_site_id (int) ID of the user's site that the current token provides access to
token_scope (array) Scopes that the current access token provides access to
avatar_URL (url) Gravatar image URL
profile_URL (url) Gravatar Profile URL
verified (bool) Has the account been verified (via WordPress.com Connect)?
email_verified (bool) Has the account been verified (via email)?
date (iso 8601 datetime) Datetime the user joined WordPress.com
site_count (int) Number of sites where the user is a member
visible_site_count (int) Number of sites where the user is a member, set to visible in user settings
has_unseen_notes (bool) Does the account have unseen notifications
newest_note_type (string) notification type slug for newest unseen notification or blank if no unseen notes
meta (object) Metadata

Example

cURL

curl \
 -H 'authorization: Bearer YOUR_API_TOKEN' \
 'https://public-api.wordpress.com/rest/v1/me/?pretty=1'

PHP

<?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/me/?pretty=1',
  false,
  $context
);
$response = json_decode( $response );

?>

Response Body

{
	"ID": 1001000100,
	"display_name": "Mr. Test",
	"username": "test",
	"email": "test@example.com",
	"primary_blog": 415,
	"avatar_URL": "http:\/\/0.gravatar.com\/avatar\/a178ebb1731d432338e6bb0158720fcc?s=96&d=identicon&r=G",
	"profile_URL": "http:\/\/en.gravatar.com\/test",
	"verified" : true,
	"has_unseen_notes" : true,
	"newest_note_type" : "comment",
	"meta": {
		"links": {
			"self": "https:\/\/public-api.wordpress.com\/rest\/v1\/me",
			"help": "https:\/\/public-api.wordpress.com\/rest\/v1\/me\/help",
			"site": "https:\/\/public-api.wordpress.com\/rest\/v1\/sites\/30434183"
		}
	}
}