curl \
-H 'authorization: Bearer YOUR_API_TOKEN' \
'https://public-api.wordpress.com/rest/v1.1/sites/82974409/media/934'
<?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/sites/82974409/media/934',
false,
$context
);
$response = json_decode( $response );
?>
Response
{
"ID": 934,
"URL": "https:\/\/apiexamples.files.wordpress.com\/2015\/04\/screen-shot-2015-04-19-at-8-53-25-am.png",
"guid": "http:\/\/apiexamples.files.wordpress.com\/2015\/04\/screen-shot-2015-04-19-at-8-53-25-am.png",
"date": "2015-04-19T15:53:38+00:00",
"post_ID": 0,
"author_ID": 422,
"file": "screen-shot-2015-04-19-at-8-53-25-am.png",
"mime_type": "image\/png",
"extension": "png",
"title": "Test Image",
"caption": "",
"description": "testing.",
"alt": "",
"icon": "https:\/\/s1.wp.com\/wp-includes\/images\/media\/default.png",
"size": "0.00 B",
"thumbnails": {
"thumbnail": "https:\/\/apiexamples.files.wordpress.com\/2015\/04\/screen-shot-2015-04-19-at-8-53-25-am.png?w=150",
"medium": "https:\/\/apiexamples.files.wordpress.com\/2015\/04\/screen-shot-2015-04-19-at-8-53-25-am.png?w=300",
"large": "https:\/\/apiexamples.files.wordpress.com\/2015\/04\/screen-shot-2015-04-19-at-8-53-25-am.png?w=810",
"newspack-article-block-landscape-large": "https:\/\/apiexamples.files.wordpress.com\/2015\/04\/screen-shot-2015-04-19-at-8-53-25-am.png?w=810&h=384&crop=1",
"newspack-article-block-portrait-large": "https:\/\/apiexamples.files.wordpress.com\/2015\/04\/screen-shot-2015-04-19-at-8-53-25-am.png?w=810&h=384&crop=1",
"newspack-article-block-square-large": "https:\/\/apiexamples.files.wordpress.com\/2015\/04\/screen-shot-2015-04-19-at-8-53-25-am.png?w=810&h=384&crop=1",
"newspack-article-block-landscape-medium": "https:\/\/apiexamples.files.wordpress.com\/2015\/04\/screen-shot-2015-04-19-at-8-53-25-am.png?w=800&h=384&crop=1",
"newspack-article-block-portrait-medium": "https:\/\/apiexamples.files.wordpress.com\/2015\/04\/screen-shot-2015-04-19-at-8-53-25-am.png?w=600&h=384&crop=1",
"newspack-article-block-square-medium": "https:\/\/apiexamples.files.wordpress.com\/2015\/04\/screen-shot-2015-04-19-at-8-53-25-am.png?w=800&h=384&crop=1",
"newspack-article-block-landscape-intermediate": "https:\/\/apiexamples.files.wordpress.com\/2015\/04\/screen-shot-2015-04-19-at-8-53-25-am.png?w=600&h=384&crop=1",
"newspack-article-block-portrait-intermediate": "https:\/\/apiexamples.files.wordpress.com\/2015\/04\/screen-shot-2015-04-19-at-8-53-25-am.png?w=450&h=384&crop=1",
"newspack-article-block-square-intermediate": "https:\/\/apiexamples.files.wordpress.com\/2015\/04\/screen-shot-2015-04-19-at-8-53-25-am.png?w=600&h=384&crop=1",
"newspack-article-block-landscape-small": "https:\/\/apiexamples.files.wordpress.com\/2015\/04\/screen-shot-2015-04-19-at-8-53-25-am.png?w=400&h=300&crop=1",
"newspack-article-block-portrait-small": "https:\/\/apiexamples.files.wordpress.com\/2015\/04\/screen-shot-2015-04-19-at-8-53-25-am.png?w=300&h=384&crop=1",
"newspack-article-block-square-small": "https:\/\/apiexamples.files.wordpress.com\/2015\/04\/screen-shot-2015-04-19-at-8-53-25-am.png?w=400&h=384&crop=1",
"newspack-article-block-landscape-tiny": "https:\/\/apiexamples.files.wordpress.com\/2015\/04\/screen-shot-2015-04-19-at-8-53-25-am.png?w=200&h=150&crop=1",
"newspack-article-block-portrait-tiny": "https:\/\/apiexamples.files.wordpress.com\/2015\/04\/screen-shot-2015-04-19-at-8-53-25-am.png?w=150&h=200&crop=1",
"newspack-article-block-square-tiny": "https:\/\/apiexamples.files.wordpress.com\/2015\/04\/screen-shot-2015-04-19-at-8-53-25-am.png?w=200&h=200&crop=1",
"newspack-article-block-uncropped": "https:\/\/apiexamples.files.wordpress.com\/2015\/04\/screen-shot-2015-04-19-at-8-53-25-am.png?w=810",
"post-thumbnail": "https:\/\/apiexamples.files.wordpress.com\/2015\/04\/screen-shot-2015-04-19-at-8-53-25-am.png?w=810&h=260&crop=1"
},
"height": 384,
"width": 810,
"exif": {
"aperture": 0,
"credit": "",
"camera": "",
"caption": "",
"created_timestamp": 0,
"copyright": "",
"focal_length": 0,
"iso": 0,
"shutter_speed": 0,
"title": "",
"orientation": 0
},
"meta": {
"links": {
"self": "https:\/\/public-api.wordpress.com\/rest\/v1.1\/sites\/82974409\/media\/934",
"help": "https:\/\/public-api.wordpress.com\/rest\/v1.1\/sites\/82974409\/media\/934\/help",
"site": "https:\/\/public-api.wordpress.com\/rest\/v1.1\/sites\/82974409"
}
}
}