Get a Shopify store's products
curl --request POST \
--url https://api.stophy.dev/v1/shopify/products \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"store": "allbirds.com",
"limit": 50
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({store: 'allbirds.com', limit: 50})
};
fetch('https://api.stophy.dev/v1/shopify/products', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.stophy.dev/v1/shopify/products"
payload = {
"store": "allbirds.com",
"limit": 50
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"data": {
"products": [
{
"url": "<string>",
"isAvailable": true,
"id": "<string>",
"slug": "<string>",
"title": "<string>",
"vendor": "<string>",
"productType": "<string>",
"tags": [
"<string>"
],
"description": "<string>",
"price": 1,
"maxPrice": 1,
"originalPrice": 1,
"options": [
{
"name": "<string>",
"values": [
"<string>"
]
}
],
"variants": [
{
"isAvailable": true,
"id": "<string>",
"title": "<string>",
"sku": "<string>",
"price": 1,
"originalPrice": 1,
"options": [
"<string>"
],
"weightGrams": 123
}
],
"images": [
{
"url": "<string>",
"caption": "<string>",
"alt": "<string>"
}
],
"publishedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"cursor": "<string>"
},
"creditsUsed": 123,
"requestId": "<string>"
}{
"success": false,
"error": {
"code": "cliSessionCompleted",
"message": "<string>",
"retryable": true,
"requestId": "<string>",
"retryAfterSeconds": 123
}
}{
"success": false,
"error": {
"code": "cliSessionCompleted",
"message": "<string>",
"retryable": true,
"requestId": "<string>",
"retryAfterSeconds": 123
}
}Shopify
Shopify Products API
Call the Shopify Products API to get slug, title, vendor, product type, tags and description, as JSON or markdown. 1 credit per 25 items, at least 1 credit.
POST
/
v1
/
shopify
/
products
Get a Shopify store's products
curl --request POST \
--url https://api.stophy.dev/v1/shopify/products \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"store": "allbirds.com",
"limit": 50
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({store: 'allbirds.com', limit: 50})
};
fetch('https://api.stophy.dev/v1/shopify/products', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.stophy.dev/v1/shopify/products"
payload = {
"store": "allbirds.com",
"limit": 50
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"data": {
"products": [
{
"url": "<string>",
"isAvailable": true,
"id": "<string>",
"slug": "<string>",
"title": "<string>",
"vendor": "<string>",
"productType": "<string>",
"tags": [
"<string>"
],
"description": "<string>",
"price": 1,
"maxPrice": 1,
"originalPrice": 1,
"options": [
{
"name": "<string>",
"values": [
"<string>"
]
}
],
"variants": [
{
"isAvailable": true,
"id": "<string>",
"title": "<string>",
"sku": "<string>",
"price": 1,
"originalPrice": 1,
"options": [
"<string>"
],
"weightGrams": 123
}
],
"images": [
{
"url": "<string>",
"caption": "<string>",
"alt": "<string>"
}
],
"publishedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"cursor": "<string>"
},
"creditsUsed": 123,
"requestId": "<string>"
}{
"success": false,
"error": {
"code": "cliSessionCompleted",
"message": "<string>",
"retryable": true,
"requestId": "<string>",
"retryAfterSeconds": 123
}
}{
"success": false,
"error": {
"code": "cliSessionCompleted",
"message": "<string>",
"retryable": true,
"requestId": "<string>",
"retryAfterSeconds": 123
}
}- Endpoint:
shopify.products - Returns:
datahasproducts. - Cost: 1 credit per 25 items, at least 1 credit. Failed calls cost nothing.
- Paging: Yes. Send the
cursorfrom the response to get the next page. See Paging.
Example
import { Stophy } from "stophy";
const stophy = new Stophy({ apiKey: process.env.STOPHY_API_KEY });
const result = await stophy.shopify.products({ store: "allbirds.com", limit: 50 });
console.log(result.data.products);
from stophy import Stophy
stophy = Stophy() # reads STOPHY_API_KEY
result = stophy.shopify.products(store="allbirds.com", limit=50)
print(result["data"]["products"])
curl -X POST https://api.stophy.dev/v1/shopify/products \
-H "Authorization: Bearer $STOPHY_API_KEY" \
-H "content-type: application/json" \
-d '{"store":"allbirds.com","limit":50}'
stophy shopify products allbirds.com --limit 50
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json