Shopify Fast Scraper

FREEMIUM
Por Ardechoft Inc | Actualizada hace 2 meses | eCommerce
Popularidad

9.1 / 10

Latencia

1,224ms

Nivel de servicio

100%

Health Check

N/A

Volver a todos los tutoriales (3)

Retrieve all the products from a store

The first step is to find the URL of a Shopify store. Only the domain name is required for the store endpoint. For instance if we take this product url: https://shop.flipperzero.one/collections/flipper-zero-accessories/products/flipper-silicone-case the store url is the domain name so: https://shop.flipperzero.one. We will use it as input.

const axios = require('axios');

const options = {
  method: 'GET',
  url: 'https://shopify-fast-scraper.p.rapidapi.com/store',
  params: {
    url: 'https://shop.flipperzero.one/',
    page: '1'
  },
  headers: {
    'X-RapidAPI-Key': '[YOUR KEY]',
    'X-RapidAPI-Host': 'shopify-fast-scraper.p.rapidapi.com'
  }
};

try {
	const response = await axios.request(options);
	console.log(response.data);
} catch (error) {
	console.error(error);
}

We obtain the following result:

{
	"storeUrl": "https://shop.flipperzero.one/",
	"page_start": 1,
	"page_end": 1,
	"page_size": "5 collections or less",
	"current_page": 1,
	"collection_count_total": 3,
	"collection_count_page": 3,
	"collections": [{
			"id": 292570267801,
			"title": "Flipper Zero Accessories",
			"handle": "flipper-zero-accessories",
			"description": "",
			"published_at": "2021-12-15T17:08:38Z",
			"updated_at": "2023-07-16T10:00:08Z",
			"image": null,
			"products_count": 4,
			"products": [...]
	},
	{...}]
}

Some store have lots of collections, only five will be returned on each call. The page parameter is used to get the five next collections by incrementing the page number, page 1 (the first one) is the default value.

Static properties

page_start gives the index of the first page, it will always be 1, the goal is to tell the user that the first page doesn’t start at 0.
page_size indicates the number of collections on the page using words, it should always be “5 collections or less”

Dynamic properties

page_end gives the index of the last page, basically in order to get all the collections from the store, the user should go from page_start to page_end.
current_page is the index of the page returned.
collection_count_total the total number of collections on the store.
collection_count_page the number of collections returned on this page, it should always be five unless the last page is being returned, in that case is could be less.

For each collection you will get the following response:

{
	"id": 292570267801,
	"title": "Flipper Zero Accessories",
	"handle": "flipper-zero-accessories",
	"description": "",
	"published_at": "2021-12-15T17:08:38Z",
	"updated_at": "2023-07-03T07:10:09Z",
	"image": null,
	"products_count": 4,
	"products": [{
			"id": 6146340520089,
			"title": "Silicone Case for Flipper Zero",
			"handle": "flipper-silicone-case",
			"body_html": "<p><strong>Protective Silicone Case for your Flipper Zero.</strong></p>\n<p>\"ФЛИППЕР\" means \"Flipper\" in Cyrillic. Soft and smooth, this \"ФЛИППЕР\" silicone case will make your cyber companion even stronger, preserving an astonishing look with a little touch of Russian vibe showing its roots.<br>&lt;meta charset=\"UTF-8\"&gt;</p>",
			"published_at": "2021-08-30T13:47:52Z",
			"created_at": "2021-02-11T17:45:12Z",
			"updated_at": "2023-07-03T07:05:04Z",
			"vendor": "Flipper Devices",
			"product_type": "Accessories",
			"tags": [],
			"variants": [...],
			"images": [...],
			"options": [{
				"name": "Title",
				"position": 1,
				"values": [
					"Default Title"
				]
			}]
		},
		...
	]
}

The collection data is returned: title, handle, description, … but also all the products from the collection. Each product contains the same data as what the /product endpoint would return.

Warning

If a collection has more than 500 products, only the url of the products are returned and not the full products data. For each product url the endpoint /product can then be used with the product url in order to get the full product data.

The result looks like:

"products": [
        "https://denydesigns.com/products/henrike-schenk-travel-photography-garden-of-daisy-flowers-framed-wall-art-1",
        "https://denydesigns.com/products/henrike-schenk-travel-photography-white-tulips-in-spring-in-holland-framed-wall-art-3",
        "https://denydesigns.com/products/henrike-schenk-travel-photography-sorrento-stripes-framed-wall-art-1",
				...
]

For each product url, the full detail of the product can be retrieved using the /product endpoint, a tutorial is available here.

The products_count property gives the number of product in the collection.

While using the API you can get some errors:

  • Is it a valid Shopify product url? If you believe it is send an email to support@ardechoft.com and we will solve the issue! -> Double check that the URL is indeed the url from a collection.
  • It seems you are trying to access lots of products for the same store and Shopify is rate limiting us. Use the /collection or /store endpoint to get the same products with less requests. Try again in a moment. -> It means two many requests to the same shop have been made, add some delay between two calls to the API.