Instagram 为此提供了 API 调用。它以 JSON 格式返回您需要的所有内容,只需提供以下短 URL:
http://api.instagram.com/oembed?url=http://instagr.am/p/XXXXXX/
你会得到这样的数据:
{
provider_url: "http://instagr.am/",
title: "Rays",
url: "http://distillery.s3.amazonaws.com/media/2010/10/02/7e4051fdcf1d45ab9bc1fba2582c0c6b_7.jpg",
author_name: "danrubin",
media_id: "5382_72",
author_id: 72,
height: 612,
width: 612,
version: "1.0",
author_url: "http://instagr.am/",
provider_name: "Instagram",
type: "photo"
}
或者,如果您想要的只是图片,您可以在 URL 中添加 /media:
http://instagr.am/p/XXXXXX/media