Is there a way to call information from websites?

Not favoritedFavorited Favorited 0 favourites
  • 15 posts
From the Asset Store
Basic clone of a 80's arcade game called Gyruss that was quite fun to play!
  • I'm making a pack simulator for a card game and there's two things I want to do. One is to call price information from a website. TCGPlayer is a common website for most people that play TCGs competitively in America and they have a market price listed. I was wondering if I could link that number to something in game to keep the price updating. Another thing is possibly making my sprites called off from images on websites. The people that make the card game I'm doing this for keep high quality images of all their cards on their website. Which is a good thing for quality, but unfortunately would make this project take up a load of storage. So I was hoping to call the images off their website, and not have to use AI to reduce the quality of every last card.

  • Use the AJAX plugin to query TCG's API and use the Sprite plugin's load image from URL action.

  • Use the AJAX plugin to query TCG's API and use the Sprite plugin's load image from URL action.

    How do I do that with AJAX. Also, not really getting the sprite thing to work, did I do it wrong? (I did also tested it on Anonymous)

  • Try this:

    Sprite: Load image from "https://corsproxy.io/?url=https://samplelib.com/lib/preview/png/sample-bumblebee-400x300.png" (Resize to image size, cross-origin anonymous)

    Note that the TCG website may have policies that prevent downloading their content directly. You may need to use a CORS proxy, as in my example. The best solution is to avoid loading cards from an external server altogether - keep them in your project or host them on your own server.

  • Try this:

    Sprite: Load image from "https://corsproxy.io/?url=https://samplelib.com/lib/preview/png/sample-bumblebee-400x300.png" (Resize to image size, cross-origin anonymous)

    Note that the TCG website may have policies that prevent downloading their content directly. You may need to use a CORS proxy, as in my example. The best solution is to avoid loading cards from an external server altogether - keep them in your project or host them on your own server.

    Thank you, I moved it over to a discord message and it worked, I'm now using the CORS thing and it's also working, I appreciate it. Do you know the solution for my other question though?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Do they have an API? If not, scraping the prices from the website may be quite difficult.

    Looks like they have, but not accepting new users:

  • Do they have an API? If not, scraping the prices from the website may be quite difficult.

    Looks like they have, but not accepting new users:

    Difficult? How so?

  • You'll need to look for a specific bit of information (card price) in a large html, it can be challenging.

    en.wikipedia.org/wiki/Web_scraping

  • You'll need to look for a specific bit of information (card price) in a large html, it can be challenging.

    https://en.wikipedia.org/wiki/Web_scraping

    I asked someone how they do it for their website and this is what they said to me

    "I actually get the prices manually from the seller page and then process the CSV file. It does not require a key, but I think it might require being a seller with a certain number of sales."

    I don't know if this can also apply to construct or not.

  • You can of course create/download a CSV file and import it into Construct project. But that would be a manual job.

  • You can of course create/download a CSV file and import it into Construct project. But that would be a manual job.

    Oh that's fine, i assume there's decent tutorials on YouTube?

    Or do you mean I'd need to update each price manually? As long as I don't have to do that one whenever a price change happens I'm chilling.

    Also, let's say I did learn how to scrape it real quick... how does this help me? Like how am I uploading it to Construct and keeping it up to date?

  • How often do you need to refresh the prices in your app? Every day? Every hour? Or do you always need to display the most accurate real-time price from their website?

  • How often do you need to refresh the prices in your app? Every day? Every hour? Or do you always need to display the most accurate real-time price from their website?

    I'd like the most accurate real time price. I'd like to have the listed Market (average of what it sells for) and maybe the listed low.

  • Then you need an API access.

    You can probably try scraping prices from their website, but it will be difficult and slow and your app/ip may get banned.

  • Then you need an API access.

    You can probably try scraping prices from their website, but it will be difficult and slow and your app/ip may get banned.

    I see, then I guess it's not too important, I was just hopeful since it's a feature pack openers for other card games normally have, but that may be different for a website as apposed to a game. Just wanted it to feel professional.

Jump to:
Active Users
There are 0 visitors browsing this topic (0 users and 0 guests)