Skip to main content

Get products by ID

Gets information about products by array of IDs

Function GetProductsByID(Val Products, Val Parameters = "") Export

ParameterCLI optionTypeRequiredDescription
Products--itemsString, Array of StringArray of product IDs
Parameters--authStructure Of StringAuthorization JSON or path to .json

Returns: Map Of KeyAndValue - serialized JSON response from VK


1C:Enterprise/OneScript code example
    Parameters = GetVKParameters();

Item1 = "9826149";
Item2 = "9826150";

ProductsArray = New Array;
ProductsArray.Add(Item1);
ProductsArray.Add(Item2);

Result = OPI_VK.GetProductsByID(ProductsArray, Parameters);
    # JSON data can also be passed as a path to a .json file

oint vk GetProductsByID \
--items "[9916004,9916005]" \
--auth "{'access_token':'***','owner_id':'-218861756','app_id':'51694790','group_id':'218861756'}"
Result
{
"response": {
"count": 2,
"items": [
{
"availability": 0,
"category": {
"inner_type": "market_market_category_old",
"id": 20173,
"name": "Батарейки",
"section": {
"id": 10016,
"name": "Канцелярские товары"
}
},
"description": "Product description",
"id": 9709213,
"owner_id": -218861756,
"price": {
"amount": "100",
"currency": {
"id": 643,
"name": "RUB",
"title": "₽"
},
"text": "1 ₽",
"discount_rate": -93,
"old_amount": "1500",
"old_amount_text": "15 ₽"
},
"title": "Test product (with prop)",
"other_items": [
{
"title": "Другие товары сообщества",
"view_type": 1,
"item_ids": [
"-218861756_9709215",
"-218861756_9642576",
"-218861756_9640025",
"-218861756_9578921",
"-218861756_9499082",
"-218861756_9423489",
"-218861756_9387853",
"-218861756_9320009",
"-218861756_9320008",
"-218861756_9259547"
],
"referrer_item_type": "other_goods"
}
],
"dimensions": {
"width": 20,
"height": 30,
"length": 40
},
"weight": 100,
"albums_ids": [],
"photos": [
{
"album_id": -53,
"date": 1728453912,
"id": 457249082,
"owner_id": -218861756,
"access_key": "6f2a29d38b1ed801b2",
"sizes": [
{
"height": 56,
"type": "s",
"width": 75,
"url": "https://sun9-13.userapi.com/s/v1/ig2/BRraTEhjTmc3iomRoahXiRER1_N-S0W-HiUcs_bp7AAd8lLn6tJus30pTY0eioD8NnB7l3aFZaLh9Wb-NZ8Xqsf4.jpg?quality=95&as=32x24,48x36,72x54,108x81,160x120,240x180,360x270,480x360,540x405,640x480,720x540,1080x810,1280x960,1440x1080,2560x1920&from=bu&cs=75x56"
},
{
"height": 97,
"type": "m",
"width": 130,
"url": "https://sun9-13.userapi.com/s/v1/ig2/BRraTEhjTmc3iomRoahXiRER1_N-S0W-HiUcs_bp7AAd8lLn6tJus30pTY0eioD8NnB7l3aFZaLh9Wb-NZ8Xqsf4.jpg?quality=95&as=32x24,48x36,72x54,108x81,160x120,240x180,360x270,480x360,540x405,640x480,720x540,1080x810,1280x960,1440x1080,2560x1920&from=bu&cs=130x97"
},
{
"height": 453,
"type": "x",
"width": 604,
"url": "https://sun9-13.userapi.com/s/v1/ig2/BRraTEhjTmc3iomRoahXiRER1_N-S0W-HiUcs_bp7AAd8lLn6tJus30pTY0eioD8NnB7l3aFZaLh9Wb-NZ8Xqsf4.jpg?quality=95&as=32x24,48x36,72x54,108x81,160x120,240x180,360x270,480x360,540x405,640x480,720x540,1080x810,1280x960,1440x1080,2560x1920&from=bu&cs=604x453"
},
{
"height": 605,
"type": "y",
"width": 807,
"url": "https://sun9-13.userapi.com/s/v1/ig2/BRraTEhjTmc3iomRoahXiRER1_N-S0W-HiUcs_bp7AAd8lLn6tJus30pTY0eioD8NnB7l3aFZaLh9Wb-NZ8Xqsf4.jpg?quality=95&as=32x24,48x36,72x54,108x81,160x120,240x180,360x270,480x360,540x405,640x480,720x540,1080x810,1280x960,1440x1080,2560x1920&from=bu&cs=807x605"
},
{
"height": 960,
"type": "z",
"width": 1280,
"url": "https://sun9-13.userapi.com/s/v1/ig2/BRraTEhjTmc3iomRoahXiRER1_N-S0W-HiUcs_bp7AAd8lLn6tJus30pTY0eioD8NnB7l3aFZaLh9Wb-NZ8Xqsf4.jpg?quality=95&as=32x24,48x36,72x54,108x81,160x120,240x180,360x270,480x360,540x405,640x480,720x540,1080x810,1280x960,1440x1080,2560x1920&from=bu&cs=1280x960"
},
{
"height": 1920,
"type": "w",
"width": 2560,
"url": "https://sun9-13.userapi.com/s/v1/ig2/BRraTEhjTmc3iomRoahXiRER1_N-S0W-HiUcs_bp7AAd8lLn6tJus30pTY0eioD8NnB7l3aFZaLh9Wb-NZ8Xqsf4.jpg?quality=95&as=32x24,48x36,72x54,108x81,160x120,240x180,360x270,480x360,540x405,640x480,720x540,1080x810,1280x960,1440x1080,2560x1920&from=bu&cs=2560x1920"
},
{
"height": 97,
"type": "o",
"width": 130,
"url": "https://sun9-13.userapi.com/s/v1/ig2/BRraTEhjTmc3iomRoahXiRER1_N-S0W-HiUcs_bp7AAd8lLn6tJus30pTY0eioD8NnB7l3aFZaLh9Wb-NZ8Xqsf4.jpg?quality=95&as=32x24,48x36,72x54,108x81,160x120,240x180,360x270,480x360,540x405,640x480,720x540,1080x810,1280x960,1440x1080,2560x1920&from=bu&cs=130x97"
},
{
"height": 150,
"type": "p",
"width": 200,
"url": "https://sun9-13.userapi.com/s/v1/ig2/BRraTEhjTmc3iomRoahXiRER1_N-S0W-HiUcs_bp7AAd8lLn6tJus30pTY0eioD8NnB7l3aFZaLh9Wb-NZ8Xqsf4.jpg?quality=95&as=32x24,48x36,72x54,108x81,160x120,240x180,360x270,480x360,540x405,640x480,720x540,1080x810,1280x960,1440x1080,2560x1920&from=bu&cs=200x150"
},
{
"height": 240,
"type": "q",
"width": 320,
"url": "https://sun9-13.userapi.com/s/v1/ig2/BRraTEhjTmc3iomRoahXiRER1_N-S0W-HiUcs_bp7AAd8lLn6tJus30pTY0eioD8NnB7l3aFZaLh9Wb-NZ8Xqsf4.jpg?quality=95&as=32x24,48x36,72x54,108x81,160x120,240x180,360x270,480x360,540x405,640x480,720x540,1080x810,1280x960,1440x1080,2560x1920&from=bu&cs=320x240"
},
{
"height": 382,
"type": "r",
"width": 510,
"url": "https://sun9-13.userapi.com/s/v1/ig2/BRraTEhjTmc3iomRoahXiRER1_N-S0W-HiUcs_bp7AAd8lLn6tJus30pTY0eioD8NnB7l3aFZaLh9Wb-NZ8Xqsf4.jpg?quality=95&as=32x24,48x36,72x54,108x81,160x120,240x180,360x270,480x360,540x405,640x480,720x540,1080x810,1280x960,1440x1080,2560x1920&from=bu&cs=510x382"
}
],
"text": "",
"user_id": 100,
"web_view_token": "12496d9e422e90cedd",
"has_tags": false,
"orig_photo": {
"height": 1920,
"type": "base",
"url": "https://sun9-13.userapi.com/s/v1/ig2/BRraTEhjTmc3iomRoahXiRER1_N-S0W-HiUcs_bp7AAd8lLn6tJus30pTY0eioD8NnB7l3aFZaLh9Wb-NZ8Xqsf4.jpg?quality=95&as=32x24,48x36,72x54,108x81,160x120,240x180,360x270,480x360,540x405,640x480,720x540,1080x810,1280x960,1440x1080,2560x1920&from=bu",
"width": 2560
}
},
{
"album_id": -53,
"date": 1728453916,
"id": 457249083,
"owner_id": -218861756,
"access_key": "b72689d2618669fe74",
"sizes": [
{
"height": 56,
"type": "s",
"width": 75,
"url": "https://sun9-13.userapi.com/s/v1/ig2/GbPNCmNwr6zHgzZoHvTc_U72QL6bfQMRxksnAvEjdkAe7RjmsCkewnYf56isbGizhc84sSxBerTju5bf53Rt_BRs.jpg?quality=95&as=32x24,48x36,72x54,108x81,160x120,240x180,360x270,480x360,540x405,640x480,720x540,1080x810,1280x960,1440x1080,2560x1920&from=bu&cs=75x56"
},
...