I’m currently developing my website, and it would be awesome if the marketplace could have an API to easily get product data.
On one of my web pages, I display a “card” for each of my marketplace items with a link. At the moment, I do this by creating an XML file and manually filling in the fields, which the page can then use to semi-dynamically update the contents of that page.
Would be cool if I could just do a GET request and dynamically fill my page
I’m thinking it may be possible to crawl the individual product pages. On the actual product pages, the elements with the product details have nice, human readable class names related to what they contain.Firstly we would want a way to retrieve the urls for each of the products from you main seller page. You will probably be able to crawl the thumbnails from this page too. Then on the product page, we can retreive a few details.
Inside “asset-details”:
“image-gallery-image” Will give us the first image on the product page. This isn’t the thumbnail though, so not perfect.
“post-title” will give us the title
“asset-detail-text”. Product description. This is the full description though, so you might have to generate a short text from that.
“base-price” Will give us the price
“save-discount” will give us the discounted rate, if any
The og tags in the header is another source of details you can crawl
On the profile page, where your products are listed.
It looks like the assets are listed in a container named “clearfix” inside “asset-list-group”
Each product looks like it has its own container called “asset-container”
Inside the div with name “image-box” you will find both the thumbnail url, and the product page url
It also looks like you can use the images alt and title tags to get the product title. Looks like they just use that for the alt/title tags.
The price can be found under “asset-price”
The category can be found inside the anchor with the class “mock-ellipsis-item-cat” under “category-full-view”