Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6973453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:06:36+00:00 2026-05-27T17:06:36+00:00

I have the following code: <?php $url = ‘https://www.googleapis.com/shopping/search/v1/public/products?key=keyhere&country=US&q=xbox+360’; $data = curl_init($url); // Tell

  • 0

I have the following code:

<?php 
$url = 'https://www.googleapis.com/shopping/search/v1/public/products?key=keyhere&country=US&q=xbox+360';
$data = curl_init($url);

// Tell curl_exec to return the text instead of sending it to STDOUT
curl_setopt($data, CURLOPT_RETURNTRANSFER, TRUE);

// Don't include return header in output
curl_setopt($data, CURLOPT_HEADER, 0);

$product_result = curl_exec($data);
curl_close($data);

echo $product_result;

$arr = json_decode($product_result, true);

$price_arr = array();
foreach($arr['product'] as $a){
    $price_arr[] = $a['price'];
}


?>

it currently outputs stuff like:

{ "kind": "shopping#products", "etag": "\"czKOfew9E3svi7vOBQ3vsAgGZzo/kqYbSV91W3yhAtZVqqRNuag3TY8\"", "id": "tag:google.com,2010:shopping/products", "selfLink": "https://www.googleapis.com/shopping/search/v1/public/products?country=US&q=xbox+360&startIndex=1&maxResults=25", "nextLink": "https://www.googleapis.com/shopping/search/v1/public/products?country=US&q=xbox+360&startIndex=26&maxResults=25", "totalItems": 202230, "startIndex": 1, "itemsPerPage": 25, "currentItemCount": 25, "items": [ { "kind": "shopping#product", "id": "tag:google.com,2010:shopping/products/1113342/8881409096328278418", "selfLink": "https://www.googleapis.com/shopping/search/v1/public/products/1113342/gid/8881409096328278418", "product": { "googleId": "8881409096328278418", "author": { "name": "Walmart", "accountId": "1113342" }, "creationTime": "2011-11-13T21:18:07.000Z", "modificationTime": "2011-12-08T01:12:50.000Z", "country": "US", "language": "en", "title": "More Facts On Xbox 360 4gb Capabilities", "description": "Xbox 360 4GB ConsoleBuilt-in Wi-Fi: The new Microsoft Xbox 360 console is the only console with 802.11n Wi-Fi built-in for a faster and easier connection to Xbox LIVE. Stream HD movies and TV or download games from Xbox LIVE in 1080p and 5.1 surround sound from anywhere in the house. Compatible with b/g/n networks.Xbox LIVE: Xbox LIVE brings a world of entertainment to you. Instantly watch movies and TV streaming from Netflix. In crystal-clear HD, or download game add-ons like new levels, characters, maps and songs. Easily jump right into online multiplayer fun and play along with friends around the world. Plus, get your favorite music from Last.fm, connect with friends on Facebook and post Tweets on Twitter. Xbox LIVE is your connection to more games, entertainment and fun.Kinect-Ready: Featuring a dedicated, specialized port, this Microsoft Xbox 360 console is built to connect seamlessly with the Kinect Sensor. Kin", "link": "http://www.walmart.com/catalog/product.do?product_id=14917960&sourceid=1500000000000003142040&ci_src=14110944&ci_sku=14917960", "brand": "Microsoft", "condition": "new", "gtin": "00885370138405", "gtins": [ "00885370138405" ], "inventories": [ { "channel": "online", "availability": "inStock", "price": 199.0, "shipping": 7.97, "currency": "USD" } ], "images": [ { "link": "http://i.walmartimages.com/i/p/00/88/53/70/13/0088537013840_500X500.jpg" } ] } }, { "kind": "shopping#product", "id": "tag:google.com,2010:shopping/products/10046/10100715335711953213", "selfLink": "https://www.googleapis.com/shopping/search/v1/public/products/10046/gid/10100715335711953213", "product": { "googleId": "10100715335711953213", "author": { "name": "Target", "accountId": "10046" }, "creationTime": "2011-08-23T19:06:38.000Z", "modificationTime": "2011-12-09T22:37:12.000Z", "country": "US", "language": "en", "title": "Xbox 360 4gb Console", "description": "The new Xbox 360 4GB Console. Here today, ready for tomorrow with a brand new, leaner machine. Wi-Fi is built-in for easier connection to the world of entertainment on Xbox LIVE, where HD movies and TV stream in an instant. It s ready for the controller-free experiences of Kinect you don t just play the game, you are the game. Xbox 360 is more games, entertainment and fun. What s In The Box? Xbox 360 4GB S Console Xbox 360 Black Wireless Controller Xbox 360 Composite A/V cable (standard definition) One Month Xbox LIVE Gold Membership 1 year limited warranty on console", "link": "http://www.target.com/p/Xbox-360-4GB-Console/-/A-12885804?ref=tgt_adv_XSG10001&AFID=Froogle_df&LNM=%7C12885804&CPNG=video%20games&ci_src=14110944&ci_sku=12885804", "brand": "Microsoft", "condition": "new", "gtin": "00885370138405", "gtins": [ "00885370138405" ], "inventories": [ { "channel": "online", "availability": "inStock", "price": 199.99, "shipping": 12.85, "currency": "USD" } ], "images": [ { "link": "http://img3.targetimg3.com/wcsstore/TargetSAS/img/p/12/88/12885804.jpg" } ] } }, { "kind": "shopping#product", "id": "tag:google.com,2010:shopping/products/1161353/4408757490534070643", "selfLink": "https://www.googleapis.com/shopping/search/v1/public/products/1161353/gid/4408757490534070643", "product": { "googleId": "4408757490534070643", "author": { "name": "Buy.com", "accountId": "1161353" }, "creationTime": "2011-04-24T04:06:32.000Z", "modificationTime": "2011-12-09T06:24:51.000Z", "country": "US", "language": "en", "title": "Xbox 360 System (4GB)", "description": "Product Description The new Xbox 360. Here today, ready for tomorrow with a brand new, leaner machine in an all new black gloss finish. Wi-Fi is built-in for easier connection to the world of entertainment on Xbox LIVE, where HD movies and TV stream in an instant. Kinect Ready Featuring a dedicated, specialized port, the Xbox 360 4GB is built to connect seamlessly with the Kinect Sensor. Kinect brings games and entertainment to life in extraordinary new ways no controller required. Easy to use and instantly fun, Kinect gets everyone off the couch moving, laughing and cheering. See a ball? Kick it. Want to join a friend in the fun? Simply jump in. Even control an HD movie with a wave of your hand. Xbox LIVE Xbox LIVE brings a world of entertainment to you. Instantly watch movies and TV streaming from Netflix. In crystal-clear HD, or download game add-ons like new levels, characters, maps and songs. Easily jump right into online multiplayer fun and play along with friends around the world. Plus, get your favorite music from Last.fm and your Zune Pass, connect with friends on Facebook and post Tweets on Twitter. Xbox LIVE is your connection to more games, entertainment and fun. Looking for more than just a video game system? Just connect your Digital Camera, iPod, Zune, or other MP3 player via USB cable and immediately begin enjoying all your favorite Music and Movies on the TV that your Xbox 360 is hooked up to. It plays DVDs and CDs and you can even download the latest movies and TV shows via Xbox Live. It is a full Windows Media Extender and can connect with other PCs around the house to stream your favorite media. What Does Xbox Live Mean or Do? Join Xbox Live to have full access to the Marketplace where you can download full Games, Demos, Trailers, Movies and more. Voice, Text, and Video chat with friends and even play games together online (Note: multiplayer gaming requires Xbox Live Gold subscription). Xbox 360 Games To Watch Out For Gears of War 3 Call of Duty: Modern Warfare 3 Assassin's Creed: Revelations Tomb Raider Battlefield 3 Deus Ex: Human Revolution Child of Eden Xbox 360 Wireless Controller (black) This award-winning, high-performance wireless controller features a range of up to 30 feet and a battery life of up to 30 hours on two AA batteries. Built-in Wi-Fi The new Xbox 360 is the only console with 802.11n Wi-Fi built-in for a faster and easier connection to Xbox LIVE. Stream HD movies and TV or download games from Xbox LIVE in 1080p and 5.1 surround sound from anywhere in the house. Compatible with b/g/n networks.", "link": "http://clickfrom.buy.com/default.asp?adid=17379&sURL=http%3A%2F%2Fwww.buy.com%2Fprod%2Fxbox-360-system-4gb%2F216907636.html", "brand": "Microsoft", "condition": "new", "gtin": "00885370138405", "gtins": [ "00885370138405" ], "inventories": [ { "channel": "online", "availability": "inStock", "price": 199.99, "shipping": 0.0, "currency": "USD" } ], "images": [ { "link": "http://ak.buy.com/PI/0/1000/216907636.jpg" } ] } }, { "kind": "shopping#product", "id": "tag:google.com,2010:shopping/products/1113342/2934483943836745321", "selfLink": "https://www.googleapis.com/shopping/search/v1/public/products/1113342/gid/2934483943836745321", "product": { "googleId": "2934483943836745321", "author": { "name": "Walmart", "accountId": "1113342" }, "creationTime": "2011-03-25T21:44:47.000Z", "modificationTime": "2011-12-08T01:12:50.000Z", "country": "US", "language": "en", "title": "Xbox 360 250gb Console", "description": "The new Xbox 360 250GB console. It's here today and ready for tomorrow, with a brand-new, leaner machine in an all-new black gloss finish. Wi-Fi is built in for easier connection to the world of entertainment on Xbox LIVE, where HD movies and TV stream in an instant. It's ready for the controller-free experiences of Kinect you don't just play the game; you are the game. Kinect brings games and entertainment to life in extraordinary new ways no controller required. Easy to use and instantly f", "link": "http://www.walmart.com/catalog/product.do?

How do I get JUST the value of "price" . So for example: "price": 149.0 as 149.0, 65.0 in an array ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:06:37+00:00Added an answer on May 27, 2026 at 5:06 pm

    See below for a bit of code that will return all prices in an array.

    <?php 
    $url = 'https://www.googleapis.com/shopping/search/v1/public/products?key=AIzaSyCu8GTvifkYjWOXhOYdbyfOIP8QtVmkYBQ&country=US&q=xbox+360';
    
    $data = curl_init($url);
    curl_setopt($data, CURLOPT_RETURNTRANSFER, TRUE);
    curl_setopt($data, CURLOPT_HEADER, 0);
    
    $product_result = curl_exec($data);
    curl_close($data);
    
    
    $arr = json_decode($product_result, true);
    $prices = array();
    
    foreach ($arr['items'] as $item)
    {
        if (isset($item['product']['inventories'][0]['price']) !== false)
        {
            $prices[] = $item['product']['inventories'][0]['price'];
        }
    }
    
    
    echo '<pre>';
    print_r($prices);
    echo '</pre>';
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code: http://www.nomorepasting.com/getpaste.php?pasteid=22615 Which is called by the javascript mentioned in
I have to following code: http://www.nomorepasting.com/getpaste.php?pasteid=22987 If PHPSESSID is not already in the table
I have the following code: $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, http://www.site.com/check.php?id=1); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
Sigh, regex trouble again. I have following in $text : [img]http://www.site.com/logo.jpg[/img] and [url]http://www.site.com[/url] I
I have the following code: $(document).ready(function(){ $.ajax({ url: svc/GetTweetsByUser.php, type: POST, success: function(data) {
I have the following PHP code which simply grabs a URL behind HTTP-Basic authentication
I have following code (php), it will match img-src and replace with new url
I have the following code: $.ajax({ type: 'GET', url: 'edit_slides.php', data: { user_id: user_id
I have the following code in JS: new Ajax.Request('http://www.some_random_url.com', { parameters: { start :
I have the following post button that i use for paypal transactions: <form action=https://www.sandbox.paypal.com/cgi-bin/webscr

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.