I am developing a website where I need to display all the games related to iOS, play store and windows store. I have acquired iOS games & Windows games, but I am unable to acquire data related to android games.
I have tried various documentations mentioned in this link. But no use. Google is blocking most of them and others are not related to php.
Please suggest some latest working PHP API for extracting Google play store GAMES.
Thanks in advance.
You could try out SerpApi. We handle proxies, solve captchas, and parse all the rich structured data for you.
With the API you can extract everything you see on the Google Play Store page, including all of the reviews as well.
Example PHP code for retrieving results from GAMES category (available in other libraries also):
require 'path/to/google_search_results';
$query = [
"api_key" => "SECRET_API_KEY",
"engine" => "google_play",
"hl" => "en",
"store" => "apps",
"gl" => "us",
"apps_category" => "GAME"
];
$search = new GoogleSearch();
$results = $search->json($query);
Example JSON output:
{
"organic_results": [
{
"title": "Discover recommended games",
"see_more_link": "https://play.google.com/store/apps/collection/cluster?clp=ogoQCAESBEdBTUUqAggCUgIIAQ%3D%3D:S:ANO1ljJlEdM&gsr=ChOiChAIARIER0FNRSoCCAJSAggB:S:ANO1ljJdubc",
"see_more_token": "ChOiChAIARIER0FNRSoCCAJSAggB:S:ANO1ljJdubc",
"serpapi_link": "https://serpapi.com/search.json?engine=google_play&gl=us&hl=en&see_more_token=ChOiChAIARIER0FNRSoCCAJSAggB%3AS%3AANO1ljJdubc&store=apps",
"items": [
{
"title": "Roblox",
"link": "https://play.google.com/store/apps/details?id=com.roblox.client",
"product_id": "com.roblox.client",
"serpapi_link": "https://serpapi.com/search.json?engine=google_play_product&gl=us&hl=en&product_id=com.roblox.client&store=apps",
"rating": 4.4,
"extansion": {
"name": "Roblox Corporation",
"link": "https://play.google.com/store/apps/dev?id=5360036014478858866"
},
"thumbnail": "https://play-lh.googleusercontent.com/OCDxsiIIxiZL6ZQYcO9Sixv6Vxl9z0avSkpd5kS6SAE_ZU_V7_rlzzA0hsesT0Z4hA=s50-rw",
"images": [
"https://play-lh.googleusercontent.com/sM1bmvALGL6yYh_UnXomtkIgO9IzoVSi5Jbo9SIPcv9p73jR5S1Xz1K-0VFZwpkcgQ=w330-h185-rw"
]
},
...
]
},
{
"title": "New & updated games",
"see_more_link": "https://play.google.com/store/apps/collection/cluster?clp=SjYKKgokcHJvbW90aW9uXzMwMDA3OTFfbmV3X3JlbGVhc2VzX2dhbWVzEEoYAxIER0FNRToCCAI%3D:S:ANO1ljJYK2k&gsr=CjhKNgoqCiRwcm9tb3Rpb25fMzAwMDc5MV9uZXdfcmVsZWFzZXNfZ2FtZXMQShgDEgRHQU1FOgIIAg%3D%3D:S:ANO1ljICr10",
"see_more_token": "CjhKNgoqCiRwcm9tb3Rpb25fMzAwMDc5MV9uZXdfcmVsZWFzZXNfZ2FtZXMQShgDEgRHQU1FOgIIAg%3D%3D:S:ANO1ljICr10",
"serpapi_link": "https://serpapi.com/search.json?engine=google_play&gl=us&hl=en&see_more_token=CjhKNgoqCiRwcm9tb3Rpb25fMzAwMDc5MV9uZXdfcmVsZWFzZXNfZ2FtZXMQShgDEgRHQU1FOgIIAg%253D%253D%3AS%3AANO1ljICr10&store=apps",
"items": [
{
"title": "Subway Surfers",
"link": "https://play.google.com/store/apps/details?id=com.kiloo.subwaysurf",
"product_id": "com.kiloo.subwaysurf",
"serpapi_link": "https://serpapi.com/search.json?engine=google_play_product&gl=us&hl=en&product_id=com.kiloo.subwaysurf&store=apps",
"rating": 4.6,
"extansion": {
"name": "SYBO Games",
"link": "https://play.google.com/store/apps/dev?id=7363891306616760846"
},
"thumbnail": "https://play-lh.googleusercontent.com/N0cRWzreD-MT_IwcXKkK20Rzp10G1alWKGbw9McpfZ8Qa19SY-W3o0thOivS3BhZV4c=s50-rw",
"images": [
"https://play-lh.googleusercontent.com/i4h0nob9adP_bV7obHFJ0FSK2AwK2nGwSvml1Cudh0ni2U-Sb69wYuDzzCHFv6U3RX7T=w330-h185-rw"
]
},
...
]
},
{
"title": "Pre-registration games",
"subtitle": "Coming soon to Play",
"see_more_link": "https://play.google.com/store/apps/collection/cluster?clp=Sj0KMQorcHJvbW90aW9uXzMwMDAwMDBkNTFfcHJlX3JlZ2lzdHJhdGlvbl9nYW1lcxBKGAMSBEdBTUU6AggC:S:ANO1ljLVQMI&gsr=Cj9KPQoxCitwcm9tb3Rpb25fMzAwMDAwMGQ1MV9wcmVfcmVnaXN0cmF0aW9uX2dhbWVzEEoYAxIER0FNRToCCAI%3D:S:ANO1ljJICV4",
"see_more_token": "Cj9KPQoxCitwcm9tb3Rpb25fMzAwMDAwMGQ1MV9wcmVfcmVnaXN0cmF0aW9uX2dhbWVzEEoYAxIER0FNRToCCAI%3D:S:ANO1ljJICV4",
"serpapi_link": "https://serpapi.com/search.json?engine=google_play&gl=us&hl=en&see_more_token=Cj9KPQoxCitwcm9tb3Rpb25fMzAwMDAwMGQ1MV9wcmVfcmVnaXN0cmF0aW9uX2dhbWVzEEoYAxIER0FNRToCCAI%253D%3AS%3AANO1ljJICV4&store=apps",
"items": [
{
"title": "Diablo Immortal",
"link": "https://play.google.com/store/apps/details?id=com.blizzard.diablo.immortal",
"product_id": "com.blizzard.diablo.immortal",
"serpapi_link": "https://serpapi.com/search.json?engine=google_play_product&gl=us&hl=en&product_id=com.blizzard.diablo.immortal&store=apps",
"extansion": {
"name": "Blizzard Entertainment, Inc.",
"link": "https://play.google.com/store/apps/dev?id=8636572569301896616"
},
"thumbnail": "https://play-lh.googleusercontent.com/8DtlOHx-zIncYJE-kwHnOTBXycjAzwufkuk0uad7_MzWP17auA24THldTwhEru-b-7I=s50-rw",
"images": [
"https://play-lh.googleusercontent.com/IS3ExSTM5IskRgZQnF4RrTPUwh-D4TGlXdfahj33DGr-Y4CW55UpEeqyw6gazdpg-Q=w330-h185-rw"
]
},
...
]
},
...
},
"serpapi_pagination": {
"next": "https://serpapi.com/search.json?apps_category=GAME&engine=google_play&gl=us&hl=en&next_page_token=CsEBit_FqQO6AQgLENu_tbHXLxjbnqn8AxiCmMGOBRjprfD4Dhi_p5XjChij3diZBBjrr7AZGNzm9LsCGO3Y7eUCGMSuxcUFGKyKn6IJIIjZv3Iggf2anwEg_8m-igsgpY3k9gIggN_E5wsg6Kn7XyD_77mICiDe84i7AiDcu9vcCCDvosrNDyCGhuTFCyDKh_-IByDGsKfmCSCksMK5BSCQoczUBCDEoLO4CyDKm7-xCiC92tC9BSDl1tznASC-t4SMDBAK&store=apps",
"next_page_token": "CsEBit_FqQO6AQgLENu_tbHXLxjbnqn8AxiCmMGOBRjprfD4Dhi_p5XjChij3diZBBjrr7AZGNzm9LsCGO3Y7eUCGMSuxcUFGKyKn6IJIIjZv3Iggf2anwEg_8m-igsgpY3k9gIggN_E5wsg6Kn7XyD_77mICiDe84i7AiDcu9vcCCDvosrNDyCGhuTFCyDKh_-IByDGsKfmCSCksMK5BSCQoczUBCDEoLO4CyDKm7-xCiC92tC9BSDl1tznASC-t4SMDBAK"
}
}
Check out the documentation for more details.
Test the search live on the playground.
You can also get specific game results.
Example PHP code for retrieving Pokémon GO results:
require 'path/to/google_search_results';
$query = [
"api_key" => "SECRET_API_KEY",
"engine" => "google_play_product",
"store" => "apps",
"gl" => "us",
"product_id" => "com.nianticlabs.pokemongo"
];
$search = new GoogleSearch();
$results = $search->json($query);
Example JSON output:
{
"product_info": {
"title": "Pokémon GO",
"editors_choice": {
"link": "https://play.google.com/store/apps/editors_choice",
"thumbnail": "https://play-lh.googleusercontent.com/DGQjTn_Hp32i88g2YrbjrCwl0mqCPCzDjTwMkECh3wXyTv4y6zECR5VNbAH_At89jGgSJDQuSKsPSB-wVQ=s14-rw"
},
"authors": [
{
"name": "Niantic, Inc.",
"link": "https://play.google.com/store/apps/developer?id=Niantic,+Inc."
}
],
"categories": [
{
"name": "Adventure",
"link": "https://play.google.com/store/apps/category/GAME_ADVENTURE",
"category_id": "GAME_ADVENTURE",
"serpapi_link": "https://serpapi.com/search.json?apps_category=GAME_ADVENTURE&engine=google_play&gl=us&hl=en&store=apps"
}
],
"content_rating": {
"text": "Everyone",
"thumbnail": "https://play-lh.googleusercontent.com/IciOnDFecb5Xt50Q2jlcNC0LPI7LEGxNojroo-s3AozcyS-vDCwtq4fn7u3wZmRna8OewG9PBrWC-i7i=w56-h14-rw"
},
"rating": 4.3,
"reviews": 14951022,
"extansions": [
"Offers in-app purchases"
],
"thumbnail": "https://play-lh.googleusercontent.com/jRKLgsCxR-jPnDBogDgx2Vj2MXy0_jBhhEcGJmmCjSnScUYabjSLEyAvnCmwmiNBXw=s180-rw",
"offers": [
{
"text": "Install",
"link": "https://play.google.com/store/apps/details?id=com.nianticlabs.pokemongo&rdid=com.nianticlabs.pokemongo&feature=md&offerId"
}
],
"description": "New! Now you can battle other Pokémon GO Trainers online! Try the GO Battle League today!Join Trainers across the globe who are discovering Pokémon as they explore the world around them. Pokémon GO is the global gaming sensation that has been downloaded over 1 billion times and named “Best Mobile Game” by the Game Developers Choice Awards and “Best App of the Year” by TechCrunch._______________Uncover the world of Pokémon: Explore and discover Pokémon wherever you are! Catch more Pokémon to complete your Pokédex! Journey alongside your Buddy Pokémon to help make your Pokémon stronger and earn rewards!Compete in epic Gym battles and...Team up with other Trainers to catch powerful Pokémon during Raid Battles! It’s time to get moving—your real-life adventures await! Let’s GO!_______________Notes: - This app is free-to-play and offers in-game purchases. It is optimized for smartphones, not tablets.- Compatible with Android devices that have 2GB RAM or more and have Android Version 6.0–10.0+ installed.- Compatibility is not guaranteed for devices without GPS capabilities or devices that are connected only to Wi-Fi networks.- Application may not run on certain devices even if they have compatible OS versions installed.- It is recommended to play while connected to a network in order to obtain accurate location information.- Compatibility information may be changed at any time.- Please visit PokemonGO.com for additional compatibility information. - Information current as of October 20, 2020.Read moreCollapse"
},
"media": {
"video": {
"thumbnail": "https://play-lh.googleusercontent.com/KgDQ-Kjb2B7_jDP-8KmQDNhAmP2lqAV_w3zArOCBL7YZnQ02Qqp4VTlgdocO-4MFk4s=w720-h310-rw",
"link": "https://www.youtube.com/embed/DFXbVBFPOOs?ps=play&vq=large&rel=0&autohide=1&showinfo=0"
},
"images": [
"https://play-lh.googleusercontent.com/O-OR6Mh0AoNyiaYYaa3OJ_VHGfLqWW2qNzUUZxRRodD3fqs2Pm04FatavdNbz-jsMZM=w720-h310-rw",
...
]
},
"reviews": [
{
"title": "Aiden Cooper",
"avatar": "https://play-lh.googleusercontent.com/a-/AOh14GhjS7nHA19xmSqgW_7T3ngu5zTjDO46K9ZF--l33A",
"rating": 3,
"snippet": "Game is fun but a lot of features don't work correctly. One important example of this is Adventure Sync. I enable it and accept permissions, and I log off hoping it track throughout the day. I log on again, and it's recorded nothing at all, and says it's on. Then I log in again another time and it says it's off. Please fix this, it's very difficult to hatch eggs.",
"likes": 23,
"date": "November 29, 2021"
},
...
],
"what_s_new": {
"snippet": "Trainers, there’s always something new in Pokémon GO! - From November 5, 2021, to November 14, 2021, celebrate light overcoming darkness with an all-new event, Festival of Lights!- Visual changes have been added to indicate when either your Pokémon storage or Item Bag is full. The center of the Poké Ball menu icon will turn orange when your Pokémon storage is full and revert to gray when storage space is made available."
},
"additional_information": {
"updated": [
{
"snippet": "November 18, 2021"
}
],
"size": [
{
"snippet": "Varies with device"
}
],
"installs": [
{
"snippet": "100,000,000+"
}
],
"current_version": [
{
"snippet": "0.223.1"
}
],
"requires_android": [
{
"snippet": "6.0 and up"
}
],
"content_rating": [
{
"snippet": "EveryoneMild Fantasy ViolenceLearn more"
},
{
"snippet": "EveryoneMild Fantasy ViolenceLearn more"
},
{
"snippet": "Learn more",
"link": "https://support.google.com/googleplay?p=appgame_ratings"
}
],
"interactive_elements": [
{
"snippet": "In-Game Purchases"
}
],
"in_app_products": [
{
"snippet": "$0.99 - $99.99 per item"
}
],
"permissions": [
{
"snippet": "View details"
}
],
"report": [
{
"snippet": "Flag as inappropriate",
"link": "https://support.google.com/googleplay/?p=report_content"
}
],
"offered_by": [
{
"snippet": "Niantic, Inc."
}
],
"developer": [
{
"snippet": "Visit website",
"link": "https://niantic.helpshift.com/a/pokemon-go/?p=web"
},
{
"snippet": "pokemon-go-support#nianticlabs.com",
"link": "https://play.google.commailto:pokemon-go-support#nianticlabs.com"
},
{
"snippet": "Privacy Policy",
"link": "https://nianticlabs.com/privacy/pokemongo/en"
},
{
"snippet": "Visit websitepokemon-go-support#nianticlabs.comPrivacy PolicyOne Ferry Building, Suite 200 San Francisco, CA 94111"
}
]
},
"similar_results": [
{
"title": "Similar",
"see_more_link": "https://play.google.com/store/apps/collection/cluster?clp=ogonCBEqAggIMh8KGWNvbS5uaWFudGljbGFicy5wb2tlbW9uZ28QARgD:S:ANO1ljKcNx0&gsr=CiqiCicIESoCCAgyHwoZY29tLm5pYW50aWNsYWJzLnBva2Vtb25nbxABGAM%3D:S:ANO1ljLVe3w",
"see_more_token": "CiqiCicIESoCCAgyHwoZY29tLm5pYW50aWNsYWJzLnBva2Vtb25nbxABGAM%3D:S:ANO1ljLVe3w",
"serpapi_link": "https://serpapi.com/search.json?engine=google_play&gl=us&hl=en&see_more_token=CiqiCicIESoCCAgyHwoZY29tLm5pYW50aWNsYWJzLnBva2Vtb25nbxABGAM%253D%3AS%3AANO1ljLVe3w&store=apps",
"items": [
{
"title": "Slugterra: Slug it Out 2",
"link": "https://play.google.com/store/apps/details?id=com.dhxmedia.slugitout2",
"product_id": "com.dhxmedia.slugitout2",
"serpapi_link": "https://serpapi.com/search.json?engine=google_play_product&gl=us&hl=en&product_id=com.dhxmedia.slugitout2&store=apps",
"description": "Pick up Greneater, Aquafreak, and Nightgeist in the Ghoul Slug Pack!",
"rating": 4.7,
"extansion": {
"name": "Epic Story Interactive",
"link": "https://play.google.com/store/apps/dev?id=5905438781451669270"
},
"thumbnail": "https://play-lh.googleusercontent.com/PgphCA3N_CSH_mLekZ_0RHiXS7FOUSlZdaCIwmEGZ2Q7I4eJkJVvYSb6Q3Lt8YP3LPZf=s128-rw"
},
...
]
},
{
"title": "More by Niantic, Inc.",
"see_more_link": "https://play.google.com/store/apps/collection/cluster?clp=igM-ChkKEzc2MzI0NjkyNzI0MzEyMjQxMjkQCBgDEh8KGWNvbS5uaWFudGljbGFicy5wb2tlbW9uZ28QARgDGAE%3D:S:ANO1ljJ8G8M&gsr=CkGKAz4KGQoTNzYzMjQ2OTI3MjQzMTIyNDEyORAIGAMSHwoZY29tLm5pYW50aWNsYWJzLnBva2Vtb25nbxABGAMYAQ%3D%3D:S:ANO1ljKQOY4",
"see_more_token": "CkGKAz4KGQoTNzYzMjQ2OTI3MjQzMTIyNDEyORAIGAMSHwoZY29tLm5pYW50aWNsYWJzLnBva2Vtb25nbxABGAMYAQ%3D%3D:S:ANO1ljKQOY4",
"serpapi_link": "https://serpapi.com/search.json?engine=google_play&gl=us&hl=en&see_more_token=CkGKAz4KGQoTNzYzMjQ2OTI3MjQzMTIyNDEyORAIGAMSHwoZY29tLm5pYW50aWNsYWJzLnBva2Vtb25nbxABGAMYAQ%253D%253D%3AS%3AANO1ljKQOY4&store=apps",
"items": [
{
"title": "Pikmin Bloom",
"link": "https://play.google.com/store/apps/details?id=com.nianticlabs.pikmin",
"product_id": "com.nianticlabs.pikmin",
"serpapi_link": "https://serpapi.com/search.json?engine=google_play_product&gl=us&hl=en&product_id=com.nianticlabs.pikmin&store=apps",
"description": "Make every step count!",
"rating": 3.6,
"extansion": {
"name": "Niantic, Inc.",
"link": "https://play.google.com/store/apps/developer?id=Niantic,+Inc."
},
"thumbnail": "https://play-lh.googleusercontent.com/lZhO5dn3aCCBkqfFBMCFQeTsCaCfKA_wdmXsco4HtZoy970MSPnXTSbm5Ub-Z3glHA=s128-rw"
},
...
]
}
],
}
Check out the documentation for more details.
Test the search live on the playground.
Disclaimer: I work at SerpApi.
there is a api on API,
i'm using that api to fetch app info from play store..
u have to pass only package name of app & your srcret key (this is generated when you register on that site)
Related
I'm currently able to add products via the Magento 2 REST API (Magento 2.2.1) but have 1 major problem.
With Single Products everything is working great and I'm able to create them with images and assign images as thumbnails, etc. However with Configurable Products the images aren't being assigned as thumbnails, but are still successfully uploaded.
Here's a Single Product REST call which works fine:
{
"product": {
"sku": "08130056-DARKNAVY",
"name": "Dakine Campus 25L Backpack - Dark Navy",
"price": "44.9900",
"status": "1",
"visibility": "4",
"type_id": "simple",
"weight": "1.0000",
"extension_attributes": {
"stock_item": {
"manage_stock": 1,
"qty": "1.0000",
"is_in_stock": true
}
},
"options": [],
"tier_prices": [],
"media_gallery_entries": [{
"media_type": "image",
"label": "Dakine Campus 25L Backpack - Dark Navy",
"position": "0",
"disabled": 0,
"types": [],
"file": "\/media\/catalog\/product\/i\/\/i\/m\/image_8735.jpg",
"content": {
"base64_encoded_data": "IMAGE BASE64 HERE",
"type": "image\/jpeg",
"name": "08130056 DARKNAVY"
}
}, {
"media_type": "image",
"label": "Dakine Campus 25L Backpack - Dark Navy",
"position": "0",
"disabled": 0,
"types": ["image", "small_image", "thumbnail", "swatch_image"],
"file": "\/media\/catalog\/product\/i\/\/i\/m\/image_8736.jpg",
"content": {
"base64_encoded_data": "IMAGE BASE64 HERE",
"type": "image\/jpeg",
"name": "08130056 DARKNAVY"
}
}],
"attribute_set_id": 62,
"custom_attributes": [{
"attribute_code": "manufacturer",
"value": "503"
}, {
"attribute_code": "color",
"value": "452"
}, {
"attribute_code": "short_description",
"value": "<span>The Campus 25 litre follows the lead of our popular Campus 33 litre back-to-school backpack with a slightly smaller volume-great for smaller students or smaller workloads. Packed with all the same features including a large top compartment with a padded laptop sleeve and room for books and binders, a fleece lined pocket for sunglasses, a slim organiser pocket, and a handy insulated pocket to keep lunch and snacks cool. Padded shoulder straps and an adjustable sternum strap ensure a perfect fit. Dimensions = <\/span>18.5 x 12 x 9\" [ 47 x 31 x 23cm ]<div><ul><li>Limited Lifetime Warranty<\/li><li>600D Polyester<\/li><li>Fits most 14\" laptops<\/li><li>Insulated cooler pocket<\/li><li>Organiser pocket<\/li><li>Fleece lined pocket for sunglasses<\/li><li>Mesh side pockets<\/li><li>Adjustable sternum strap<\/li><\/ul><\/div><br>"
}, {
"attribute_code": "barcode",
"value": "610934177053"
}, {
"attribute_code": "category_ids",
"value": [350]
}, {
"attribute_code": "meta_title",
"value": "Dakine Campus 25L Backpack - Dark Navy"
}, {
"attribute_code": "meta_keyword",
"value": "dakine,campus,25l,backpack,-,dark,navy,urbansurfer,urban,surfer,mens,backpacks"
}, {
"attribute_code": "meta_description",
"value": "Dakine Campus 25L Backpack - Dark Navy - Shop online for a large range of including Dakine with fast, free shipping from an official stockist."
}, {
"attribute_code": "news_from_date",
"value": "2017-12-22 10:56:59"
}, {
"attribute_code": "news_to_date",
"value": "2018-01-22 10:56:59"
}]
},
"save_options": true
}
And here's a configurable product where for some reason the thumbnail, image, small_image and swatch aren't being set:
{
"product": {
"sku": "226787-705-29",
"name": "Levis Dawson Lace Up Boots - Dark Brown",
"price": "99.9900",
"status": "1",
"visibility": "4",
"type_id": "configurable",
"weight": 1,
"extension_attributes": {
"stock_item": {
"manage_stock": 1,
"qty": "0.0000",
"is_in_stock": true
}
},
"options": [],
"tier_prices": [],
"media_gallery_entries": [{
"media_type": "image",
"label": "Levis Dawson Lace Up Boots - Dark Brown",
"position": "0",
"disabled": 0,
"types": [],
"file": "\/media\/catalog\/product\/i\/\/i\/m\/image_8637.jpg",
"content": {
"base64_encoded_data": "IMAGE BASE64 HERE",
"type": "image\/jpeg",
"name": "226787 705 29"
}
}, {
"media_type": "image",
"label": "Levis Dawson Lace Up Boots - Dark Brown",
"position": "0",
"disabled": 0,
"types": [],
"file": "\/media\/catalog\/product\/i\/\/i\/m\/image_8638.jpg",
"content": {
"base64_encoded_data": "IMAGE BASE64 HERE",
"type": "image\/jpeg",
"name": "226787 705 29"
}
}, {
"media_type": "image",
"label": "Levis Dawson Lace Up Boots - Dark Brown",
"position": "0",
"disabled": 0,
"types": ["image", "small_image", "thumbnail", "swatch_image"],
"file": "\/media\/catalog\/product\/i\/\/i\/m\/image_8639.jpg",
"content": {
"base64_encoded_data": "IMAGE BASE64 HERE",
"type": "image\/jpeg",
"name": "226787 705 29"
}
}],
"attribute_set_id": 44,
"custom_attributes": [{
"attribute_code": "manufacturer",
"value": "537"
}, {
"attribute_code": "color",
"value": "453"
}, {
"attribute_code": "short_description",
"value": "<span>Levis Dawson Lace Up Boots Dark Brown from Levi's are a great style option for your off-duty look. Featuring a soft leather outer, this pair has padded ankles for comfort and will team well with denim.<\/span><br><ul><li>Leather Comfort Insole<\/li><li>Anatomical Design<\/li><li>High Shock Absorption<\/li><li>Genuine Leather Coating<\/li><\/ul>"
}, {
"attribute_code": "barcode",
"value": ""
}, {
"attribute_code": "category_ids",
"value": [347]
}, {
"attribute_code": "meta_title",
"value": "Levis Dawson Lace Up Boots - Dark Brown"
}, {
"attribute_code": "meta_keyword",
"value": "levis,dawson,lace,up,boots,-,dark,brown,urbansurfer,urban,surfer,levi's,mens,shoes"
}, {
"attribute_code": "meta_description",
"value": "Levis Dawson Lace Up Boots - Dark Brown - Shop online for a large range of including Levi's with fast, free shipping from an official stockist."
}, {
"attribute_code": "news_from_date",
"value": "2017-12-15 14:56:33"
}, {
"attribute_code": "news_to_date",
"value": "2018-01-15 14:56:33"
}]
},
"save_options": true
}
You can see that "types" is set the same for both calls but is just seemingly ignored for the Configurable Product, there is no trace of anything in the Magento 2 logs either.
This is consistently happening with every Configurable Product we have, yet all Single Products are working great. Child Products do not have any images set at all as intended. I've also tested adding a Configurable Product with no child products and the results are the same.
I can manually set the thumbnail, etc in the Magento 2 admin, but I need this to be automated via these REST calls. I've tried all sorts and just can't pin down what's going wrong.
I had the same problem.
Solution:
I used catalogProductAttributeMediaGalleryManagementV1 to list all media gallery items (via GET ".../V1/products/TEST_SKU/media": list "id" and other fields).
After selecting the first image (with "media_type" = "image") I created a new JSON object.
{
"entry":
{
"id": 1086,
"media_type": "image",
"label": "This is my image description",
"position": 1,
"disabled": false,
"types": [ "image", "small_image", "thumbnail" ]
}
}
After sending it using PUT (e.g. ".../V1/products/TEST_SKU/media/1086") the image saved correctly.
I am struggling to structure json response in Laravel, here's an example:
{
"0": {
"instagram": [
{
"description": "#trainedacademy taking a break. We will resume for business on Monday 😎 #nickyjanew 🌞",
"time": "Wednesday 25th October",
"image": "https://scontent-lhr3-1.cdninstagram.com/t51.2885-15/s640x640/e15/22794071_716881718510905_8530561994892247040_n.jpg",
"likes": 15,
"comments": 0,
"link": "https://www.instagram.com/p/Baq437_FRav/",
"video": "https://scontent-lhr3-1.cdninstagram.com/t50.2886-16/22831768_291580031330276_8396013842173263872_n.mp4"
},
{
"description": "Jump into a #personaltraining #career! Started college and decided it’s not for you? Want to be a Gym Instructor? Circuit Trainer? Or work towards a career in the Fire Service? Join us Weds night for open enrolment or just get some careers advice from #paulalitherland and #nickyjanew \n#mahdloyouthzone 6:30pm Wednesday 8th November 2017. \nUCAS accredited \nindustry recognised \nExclusive discounts with the Fire Team badge \nFree food box #chiaproteinbar \nWork placements #thegymgroup",
"time": "Sunday 8th October",
"image": "https://scontent-lhr3-1.cdninstagram.com/t51.2885-15/s640x640/sh0.08/e35/22277977_106714113419553_5412239854790508544_n.jpg",
"likes": 42,
"comments": 2,
"link": "https://www.instagram.com/p/BZ-WYZJloMY/",
"video": "https://scontent-lhr3-1.cdninstagram.com/t50.2886-16/22831768_291580031330276_8396013842173263872_n.mp4"
},
{
"description": "#trainedacademy #team #mahdloyouthzone preparing marketing material for 2018 enrolments. #oldhamfitness #oldham #practical #learningenhanced #alevels #employability #gymcareer #thegymgroup #chiaproteinbar",
"time": "Friday 6th October",
"image": "https://scontent-lhr3-1.cdninstagram.com/t51.2885-15/s640x640/sh0.08/e35/22280199_2265489343466713_511544494877835264_n.jpg",
"likes": 50,
"comments": 0,
"link": "https://www.instagram.com/p/BZ5hLU6FRzr/",
"video": "https://scontent-lhr3-1.cdninstagram.com/t50.2886-16/22831768_291580031330276_8396013842173263872_n.mp4"
},
What I want to do is get rid of the "0": { part of the json. Is that possible?
return response()->json(['count' => $count_instagram, ['instagram' => $instagramArray ]], 200);
You have to use like this:
return response()->json(['count' => $count_instagram, 'instagram' => $instagramArray ], 200);
Instead of
return response()->json(['count' => $count_instagram, ['instagram' => $instagramArray ]], 200);
I have a application running on ALEXA (Amazon Echo). I'm implementing Home card display with images. When for a particular call if the response has only one card. It shows perfectly fine. Screenshot attached
"Response": {
"version" : "1.0",
"sessionAttributes": {
"UserCityId": "1",
"UserCity": "London",
"latitude": "51.50735090",
"longitude": "-0.12775830",
"categoryID": "900",
"company_id": "1154916",
"first_name": "User FName",
"yes_no_for": "",
"cat_start_limit": "0",
"categoryName": "music",
"total_cat_events": "2178",
"show_rec": "5"
},
"response": {
"outputSpeech": {
"type": "PlainText",
"text": "This is what alexa speaks out"
},
"card": {
"type": "Standard",
"title": "Music events in London",
"text": "The speech passed to alexa",
"image": {
"smallImageUrl": "https:\/\/xyz.com\/version\/sports-car-1374425_960_720.jpg",
"largeImageUrl": "https:\/\/xyz.com\/version\/sports-car-1374425_960_720.jpg"
}
},
"reprompt": {
"outputSpeech": {
"type": "PlainText",
"text": "Would you like to know events for music ,sports, or something else. Please select one category"
}
},
"shouldEndSession": false
}
}
The above code works
The problem is listed below :
But if the same response has array of cards (multiple cards), alexa fails giving an error.
"Response": {
"version": "1.0",
"sessionAttributes": {
"UserCityId": "1",
"UserCity": "London",
"latitude": "51.50735090",
"longitude": "-0.12775830",
"categoryID": "900",
"customer_id": "1154916",
"first_name": "UserFNAME",
"yes_no_for": "",
"cat_start_limit": "0",
"categoryName": "music",
"total_cat_events": "2178",
"show_rec": "5"
},
"response" : {
"outputSpeech" : {
"type": "PlainText",
"text": "5th. Baba Yaga's Hut Presents Jambinai, at Corsica Studios, on Monday, May 16th , 7 30 pm"
},
"card": [{
"type": "Standard",
"title": "Music events in London",
"text": "1. Dove Jones Blues Jam!, at Phoenix Artist Club, on Monday, May 16th , 7pm",
"image": {
"smallImageUrl": "https:\/\/xyz.com\/version\/sports-car-1374425_960_720.jpg",
"largeImageUrl": "https:\/\/xyz.com\/version\/sports-car-1374425_960_720.jpg"
}
}, {
"type": "Standard",
"title": "Music events in London",
"text": "2. The Hillbilly Moon Explosion, at The Borderline, on Monday, May 16th, 7pm",
"image": {
"smallImageUrl": "https:\/\/xyz.com\/version\/sports-car-1374425_960_720.jpg",
"largeImageUrl": "https:\/\/xyz.com\/version\/sports-car-1374425_960_720.jpg"
}
}, {
"type": "Standard",
"title": "Music events in London",
"text": "3. Sian Evans Of Kosheen, at 100 Club, on Monday, May 16th , 7 30 pm",
"image": {
"smallImageUrl": "https:\/\/xyz.com\/version\/sports-car-1374425_960_720.jpg",
"largeImageUrl": "https:\/\/xyz.com\/version\/sports-car-1374425_960_720.jpg"
}
}, {
"type": "Standard",
"title": "Music events in London",
"text": "4. Rinocerose, at The Water Rats, on Monday, May 16th , 7 30 pm",
"image": {
"smallImageUrl": "https:\/\/xyz.com\/version\/sports-car-1374425_960_720.jpg",
"largeImageUrl": "https:\/\/xyz.com\/version\/sports-car-1374425_960_720.jpg"
}
}, {
"type": "Standard",
"title": "Music events in London",
"text": "5. Baba Yaga's Hut Presents Jambinai, at Corsica Studios, on Monday, May 16th , 7 30 pm",
"image": {
"smallImageUrl": "https:\/\/xyz.com\/version\/sports-car-1374425_960_720.jpg",
"largeImageUrl": "https:\/\/xyz.com\/version\/sports-car-1374425_960_720.jpg"
}
}],
"reprompt": {
"outputSpeech": {
"type": "PlainText",
"text": "Would you like to know events for music ,sports, or something else. Please select one category"
}
},
"shouldEndSession" : false
}
}
The above code doesn't work.
Here is the thing that I'm trying to convert : Please see the screenshot
For events in london call I get list of 5 events in single card. To each event I want to assign image and create its card.
Can anyone help with the approach and figure out what is the problem using multiple card in JSON response.
Is it that alexa only support single card in response ?
The card attribute on the response takes an object not an array.
Here is the example that Amazon uses on their site:
{
"version": "string",
"sessionAttributes": {
"string": object
},
"response": {
"outputSpeech": {
"type": "string",
"text": "string",
"ssml": "string"
},
"card": {
"type": "string",
"title": "string",
"content": "string",
"text": "string",
"image": {
"smallImageUrl": "string",
"largeImageUrl": "string"
}
},
"reprompt": {
"outputSpeech": {
"type": "string",
"text": "string",
"ssml": "string"
}
},
"shouldEndSession": boolean
}
}
If you wanted to try and make multiple cards, you could try sending multiple responses, but I am not sure that that would work either.
I think your best option is to consider a different interaction with the user for your problem then presenting multiple cards.
Hello all and thanks in advance,
I have data indexed on elasticsearch server in the following manner
{
'main_index':{
'type':[{
'name':'john deo',
'type':'accountant',
'description':'john deo is a great person',
'address':'somewhere in the world'
},
{
'name':'calvin kalvin',
'type':'designer',
'description':'calvin kalvin is john deo's best friend',
'address':'somewhere near'
}]
}
}
my query is when i search for great person it should also return me its sub-type, say name or type or description or address
eg.:
http://localhost:9200/some-index/type?q=great person
So along with the complete result it should also return its sub-type i.e.:description. i tried highlighter but of no use.
Please help.
How about this?
GET /my_index/type/_search?q=great person
{
"highlight": {
"fields": {"name": {},"type": {},"description": {},"address": {}}
}
}
Which gives you:
"hits": [
{
"_index": "my_index",
"_type": "type",
"_id": "1",
"_score": 0.10848885,
"_source": {
"name": "john deo",
"type": "accountant",
"description": "john deo is a great person",
"address": "somewhere in the world"
},
"highlight": {
"description": [
"john deo is a <em>great</em> <em>person</em>"
]
}
}
]
If you put, also, "world" in the search query (so q=great person world) it gives you:
"hits": [
{
"_index": "my_index",
"_type": "type",
"_id": "1",
"_score": 0.13287117,
"_source": {
"name": "john deo",
"type": "accountant",
"description": "john deo is a great person",
"address": "somewhere in the world"
},
"highlight": {
"address": [
"somewhere in the <em>world</em>"
],
"description": [
"john deo is a <em>great</em> <em>person</em>"
]
}
}
]
This app is posting to the user's timeline, using PHP and Facebook's PHP API implementation. This is working right now, for over several weeks already.
The following PHP code is being used to post a message:
if($hasPhoto === TRUE)
{
// Post to FB with picture
$facebook->setFileUploadSupport(true);
$result = $facebook->api("/me/photos", "post", array(
'message' => $message,
'place' => $place,
'source' => '#' . $photo
));
}
else
{
// Post to FB without picture
$result = $facebook->api("/me/feed", "post", array(
'message' => $message,
'place' => $place
));
}
This is working properly, except there are two formattings of the $result:
array ('id' => '103240856515XXX', )
array ('id' => '100004900175XXX_103239809849XXX', )
The Graph API documentation tells us the following:
A post from Facebook Platform: https://graph.facebook.com/19292868552_10150189643478553
A status message on the Facebook Page: https://graph.facebook.com/10150224661566729
This means the used PHP code generates posts ór status messages. I don´t see any relation between the textmessages, photos, dates, or authors. It seems to happen randomly.
The following shows the relationship from our data between the format of the id and whether a photo is attached.
select count(*) from fbposts where facebookpostid like '%\_%' and hasphoto = 1; -- 90
select count(*) from fbposts where facebookpostid like '%\_%' and hasphoto = 0; -- 87
select count(*) from fbposts where facebookpostid not like '%\_%' and hasphoto = 1; -- 47
select count(*) from fbposts where facebookpostid not like '%\_%' and hasphoto = 0; -- 54
Why does this behaviour happen? How to force a Post? The reason why this is relevant is because Post does have a Privacy property which I would like to query.
Update:
Querying a status message 545778052106XXX, given by the FB API, with a photo, gives me:
{
"id": "545778052106XXX",
"from": {
"name": "Jeffrey Krist",
"id": "100000226354XXX"
},
"name": "My message!",
"picture": "http://photos-f.ak.fbcdn.net/hphotos-ak-ash3/522827_545778052106XXX_1151562XXX_s.jpg",
"source": "http://sphotos-f.ak.fbcdn.net/hphotos-ak-ash3/s720x720/522827_545778052106XXX_1151562XXX_n.jpg",
"height": 720,
"width": 720,
"images": [
{
"height": 2048,
"width": 2048,
"source": "http://sphotos-f.ak.fbcdn.net/hphotos-ak-ash3/s2048x2048/522827_545778052106XXX_1151562XXX_n.jpg"
}, .. lots more
],
"link": "https://www.facebook.com/photo.php?fbid=545778052106402&set=p.545778052106XXX&type=1",
"icon": "http://static.ak.fbcdn.net/rsrc.php/v2/yz/r/StEh3RhPXXX.gif",
"place": {
"id": "182665821805XXX",
"name": "A company name",
"location": {
"street": "My street 13", ..
}
},
"created_time": "2012-11-01T08:35:20+0000",
"updated_time": "2012-11-01T08:35:20+0000",
"comments": ...
"likes": ...
}
Querying a post message using a id from the FB API gives me:
{
"id": "100003331805XXX_299609210160XXX",
"from": {
"name": "Some name",
"id": "100003331805XXX"
},
"message": "My message",
"picture": "http://photos-e.ak.fbcdn.net/hphotos-ak-ash3/560724_299609200160XXX_789651XXX_s.jpg",
"link": "https://www.facebook.com/photo.php?fbid=299609200160XXX&set=a.285494101571XXX.69331.100003331805XXX&type=1&relevant_count=1",
"name": "Photo album name",
"icon": "http://static.ak.fbcdn.net/rsrc.php/v2/yz/r/StEh3RhPXXX.gif",
"actions": [
{
"name": "Comment",
"link": "https://www.facebook.com/100003331805XXX/posts/299609210160XXX"
},
{
"name": "Like",
"link": "https://www.facebook.com/100003331805XXX/posts/299609210160XXX"
}
],
"privacy": {
"value": "ALL_FRIENDS", ...
},
"place": {
"id": "174171872642XXX", ...
},
"type": "photo",
"status_type": "added_photos",
"object_id": "299609200160XXX",
"application": {
"name": "My app", ...
},
"created_time": "2012-12-21T22:33:59+0000",
"updated_time": "2012-12-21T23:30:39+0000",
"likes": ...
"comments": ...
}
Querying a composed id, _ ('100000226354XXX_545778052106XXX'), which is message with a photo, gives me:
{
"error": {
"message": "Unsupported get request.",
"type": "GraphMethodException",
"code": 100
}
}
There is no need to force a post when each status message is a post object.
Status message object 10100948019328597
Post object userid_10100948019328597
Status message object
{
"id": "10100948019328597",
"from": {
"name": "phwd",
"id": "13608786"
},
"message": "Happy Thanksgiving you cool Canadians!",
"updated_time": "2012-10-08T23:17:27+0000",
"likes": {
"data": [
],
"paging": {
"next":
}
}
}
Post object
{
"id": "13608786_10100948019328597",
"from": {
"name": "phwd",
"id": "13608786"
},
"message": "Happy Thanksgiving you cool Canadians!",
"actions": [
{
"name": "Comment",
"link": "http://www.facebook.com/13608786/posts/10100948019328597"
},
{
"name": "Like",
"link": "http://www.facebook.com/13608786/posts/10100948019328597"
}
],
"privacy": {
"description": "Public",
"value": "EVERYONE",
"friends": "",
"networks": "",
"allow": "",
"deny": ""
},
"type": "status",
"status_type": "mobile_status_update",
"created_time": "2012-10-08T23:17:28+0000",
"updated_time": "2012-10-08T23:17:28+0000",
"likes": {
"data": [
]
},
"comments": {
"count": 0
}
}
The best way to check would be to compare /me/statuses vs /me/posts