A
A
atHome2017-01-19 12:35:53
In contact with
atHome, 2017-01-19 12:35:53

How to get instagram link using vk api wall.get?

Hello.
I want to pull all the reposts from Instagram from the Vkontakte wall.
For example, we take a beetle from the hand up, go to api wall.get , write owner_id 1756972, we get

{
   "response": {
      "count": 1746,
      "items": [
         {
            "id": 105733,
            "from_id": 1756972,
            "owner_id": 1756972,
            "date": 1484816534,
            "post_type": "post",
            "text": "Все богатство моё в тебе[email protected] @ Big buddha temple",
            "attachments": [
               {
                  "type": "photo",
                  "photo": {
                     "id": 456239285,
                     "album_id": -7,
                     "owner_id": 1756972,
                     "photo_75": "https://cs540105....7f8/QA3adotP1ig.jpg",
                     "photo_130": "https://cs540105....7f9/yurV4yyHCpA.jpg",
                     "photo_604": "https://cs540105....7fa/6l5HQH9JL4g.jpg",
                     "photo_807": "https://cs540105....7fb/2lt9xAO8sR0.jpg",
                     "photo_1280": "https://cs540105....7fc/_159Jte0_2k.jpg",
                     "photo_2560": "https://cs540105....7fd/rLadFbNSgVs.jpg",
                     "width": 1080,
                     "height": 1349,
                     "text": "",
                     "date": 1484816533,
                     "post_id": 105733,
                     "access_key": "306e62c9b8d0776357"
                  }
               }
            ],
            "geo": {
               "type": "point",
               "coordinates": "9.5707380060484 100.0607161591",
               "place": {
                  "id": 0,
                  "title": "4171, Самуи",
                  "latitude": 0,
                  "longitude": 0,
                  "created": 0,
                  "icon": "https://vk.com/images/places/place.png",
                  "country": "Таиланд",
                  "city": "Самуи"
               }
            },
            "post_source": {
               "type": "api",
               "platform": "instagram",
               "url": "https://www.instagram.com/p/BPcK_0lBDQq/"
            },
            "comments": {
               "count": 9,
               "can_post": 1
            },
            "likes": {
               "count": 293,
               "user_likes": 0,
               "can_like": 1,
               "can_publish": 1
            },
            "reposts": {
               "count": 3,
               "user_reposted": 0
            }
         }
      ]
   }
}

Of all this, only
"post_source": {
               "type": "api",
               "platform": "instagram",
               "url": "https://www.instagram.com/p/BPcK_0lBDQq/"
            },

If you make a similar request in the browser, post_source is not visible
https://api.vk.com/method/wall.get?owner_id=1756972&count=1&filter=owner&v=5.62

{
   "response": {
      "count": 1746,
      "items": [
         {
            "id": 105733,
            "from_id": 1756972,
            "owner_id": 1756972,
            "date": 1484816534,
            "post_type": "post",
            "text": "Все богатство моё в тебе[email protected] @ Big buddha temple",
            "attachments": [
               {
                  "type": "photo",
                  "photo": {
                     "id": 456239285,
                     "album_id": -7,
                     "owner_id": 1756972,
                     "photo_75": "https://cs540108.vk.me/c635103/v635103972/b7f8/QA3adotP1ig.jpg",
                     "photo_130": "https://cs540108.vk.me/c635103/v635103972/b7f9/yurV4yyHCpA.jpg",
                     "photo_604": "https://cs540108.vk.me/c635103/v635103972/b7fa/6l5HQH9JL4g.jpg",
                     "photo_807": "https://cs540108.vk.me/c635103/v635103972/b7fb/2lt9xAO8sR0.jpg",
                     "photo_1280": "https://cs540108.vk.me/c635103/v635103972/b7fc/_159Jte0_2k.jpg",
                     "photo_2560": "https://cs540108.vk.me/c635103/v635103972/b7fd/rLadFbNSgVs.jpg",
                     "width": 1080,
                     "height": 1349,
                     "text": "",
                     "date": 1484816533,
                     "post_id": 105733,
                     "access_key": "dbe6ecfeaab196f47e"
                  }
               }
            ],
            "geo": {
               "type": "point",
               "coordinates": "9.5707380060484 100.0607161591",
               "place": {
                  "id": 0,
                  "title": "4171, Самуи",
                  "latitude": 0,
                  "longitude": 0,
                  "created": 0,
                  "icon": "https://vk.com/images/places/place.png",
                  "country": "Таиланд",
                  "city": "Самуи"
               }
            },
            "comments": {
               "count": 10
            },
            "likes": {
               "count": 328
            },
            "reposts": {
               "count": 3
            }
         }
      ]
   }
}

Is it possible to somehow pull instagram from the user's wall?
upd.
I have a list of VK users generated, each time different. We go to the page of each user, look at the wall, if there is a repost from Instagram, then we take the link. Actually, I can’t see this link through the VK API, it’s simply not in the JSON output, although everything loads perfectly in their demo form on the site.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
Z
z0rgoyok, 2017-01-19
@z0rgoyok

Parse and look at the right fields?

M
Mark Adams, 2017-01-19
@ilyakmet

It's easier to pull it out of the Instagram Web itself .
Here in the comments it is described how to switch between search results pages.

S
Stanislav Kudelko, 2017-01-20
@flerry

All perfectly received with this request:
The answer is:

{
   "response":{
      "count":25866,
      "items":[
         {
            "id":105733,
            "from_id":1756972,
            "owner_id":1756972,
            "date":1484816534,
            "post_type":"post",
            "text":"Все богатство моё в тебе[email protected] @ Big buddha temple",
            "attachments":[
               {
                  "type":"photo",
                  "photo":{
                     "id":456239285,
                     "album_id":-7,
                     "owner_id":1756972,
                     "photo_75":"https:\/\/cs7062.vk.me\/c635103\/v635103972\/b7f8\/QA3adotP1ig.jpg",
                     "photo_130":"https:\/\/cs7062.vk.me\/c635103\/v635103972\/b7f9\/yurV4yyHCpA.jpg",
                     "photo_604":"https:\/\/cs7062.vk.me\/c635103\/v635103972\/b7fa\/6l5HQH9JL4g.jpg",
                     "photo_807":"https:\/\/cs7062.vk.me\/c635103\/v635103972\/b7fb\/2lt9xAO8sR0.jpg",
                     "photo_1280":"https:\/\/cs7062.vk.me\/c635103\/v635103972\/b7fc\/_159Jte0_2k.jpg",
                     "photo_2560":"https:\/\/cs7062.vk.me\/c635103\/v635103972\/b7fd\/rLadFbNSgVs.jpg",
                     "width":1080,
                     "height":1349,
                     "text":"",
                     "date":1484816533,
                     "post_id":105733,
                     "access_key":"730bb96f7691400fe0"
                  }
               }
            ],
            "geo":{
               "type":"point",
               "coordinates":"9.5707380060484 100.0607161591",
               "place":{
                  "id":0,
                  "title":"4171, Самуи",
                  "latitude":0.000000,
                  "longitude":0.000000,
                  "created":0,
                  "icon":"https:\/\/vk.com\/images\/places\/place.png",
                  "country":"Таиланд",
                  "city":"Самуи"
               }
            },
            "post_source":{
               "type":"api",
               "platform":"instagram",
               "url":"https:\/\/www.instagram.com\/p\/BPcK_0lBDQq\/"
            },
            "comments":{
               "count":57,
               "can_post":1
            },
            "likes":{
               "count":1263,
               "user_likes":0,
               "can_like":1,
               "can_publish":1
            },
            "reposts":{
               "count":9,
               "user_reposted":0
            }
         }
      ]
   }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question