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 8932103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:16:00+00:00 2026-06-15T09:16:00+00:00

Hi there I’m currently using an API built to scrape prices out of an

  • 0

Hi there I’m currently using an API built to scrape prices out of an MMO and display them in an array.
At the moment this is my code:

    <?php 
ini_set('max_execution_time', 0);
$data = json_decode(file_get_contents("http://www.gw2spidy.com/api/v0.9/json/all-items/all"), true);
foreach($data as $item) {
    echo '<pre>';
    print_r($data);
    echo '</pre>';
}
?>

This returns a MASSIVE array. I saved the html file and it’s around 35 megabytes.
It has every single price of every single item etc…
Okay so basically what I need is to search for an item such as ‘Dusk’ or by it’s itemID ‘29185’.
The prices and array keys change every hour so I’ve been trying to figure out a dynamic way of extracting this data every time but I’m stumped…

The arrays are structured like:

Array
(
    [count] => 19959
    [results] => Array
        (
    [15875] => Array
        (
            [data_id] => 29185
            [name] => Dusk
            [rarity] => 5
            [restriction_level] => 80
            [img] => https://dfach8bufmqqv.cloudfront.net/gw2/img/content/fabc9042.png
            [type_id] => 18
            [sub_type_id] => 6
            [price_last_changed] => 2012-12-03 08:30:49 UTC
            [max_offer_unit_price] => 3180000
            [min_sale_unit_price] => 3890000
            [offer_availability] => 5574
            [sale_availability] => 6
            [gw2db_external_id] => 63505
            [sale_price_change_last_hour] => 0
            [offer_price_change_last_hour] => 0
        )

If anyone can point me in the right direction that would be awesome! I have searched for days and days but can’t figure it out… I bet you it’s really simple too 🙁

  • 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-06-15T09:16:02+00:00Added an answer on June 15, 2026 at 9:16 am

    First of all, it would be good to know if there is a way to retrieve from the GW2 API server only the UPDATED items since your last “fetch all”. This would mean that you would only need to retrieve this entire array once, and then update the few records that are updated each time.

    1. You can split the array using something like array_chunk http://php.net/manual/en/function.array-chunk.php
    2. Use these split arrays to generate batch insert statements for a database such as MySQL.
    3. Use a simple SELECT query to retrieve the statements.

    If you want to do it without DB you’ll just have to search for the item using a for-loop…

    for($i = 0; $i < $array['count']; $i++)
    {
        if ($array['results'][$i]['name'] == 'Dusk')
         // you found the item
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know there's a lot of other questions out there that deal with this
There is a moment in my app, that I need to force to show
There is a column that exists in 2 tables. In table 1, this column
There are nice SO question and answers about this issue, but these options didn't
That's pretty much it. I'm using Nokogiri to scrape a web page what has
There is this strange situation I'm fighting on. I have 3 pages, les call
There was a smbmrx sample code using RDBSS in WDK Vista. But since WDK
There's no Sort() function for IList . Can someoene help me with this? I
There are 3 different ways to get data out of a BLOB column from
There was a thread on this in comp.lang.javascript recently where victory was announced but

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.