Created
June 18, 2015 20:01
-
-
Save al-the-x/4de8f197dd9dc25119f3 to your computer and use it in GitHub Desktop.
Using `curl` to fetch associated data from the Etsy API...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
curl -XGET https://openapi.etsy.com/listing/113244585.json \ | |
--get -d api_key=REDACTED \ | |
-d include=Variations,Images,MainImage,Shop,Shop/User | |
## See: https://www.etsy.com/developers/documentation/getting_started/resources#section_associations |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"count": 1, | |
"results": [ | |
{ | |
"listing_id": 113244585, | |
"state": "active", | |
"user_id": 5172188, | |
"category_id": 68888604, | |
"title": "Backpack: Helvetica, Rucksack, Typography, School Bag, Hipster Backpack, Nylon Backpack, College Backpack, Mens Backpack, Womens Backpack", | |
"description": "Backpack for Men & Women \r\n\r\nBACKPACK DETAILS \r\nHand-Flocked Backpack; Backpack Colors: Smokey Gray Backpack with contrasting Silver Straps; Black Backpack with Black Straps; Backpack Size: 18''(h) X 13.5''(w); Backpack made of Nylon Cordura; Original Artwork. \r\n\r\nBACKPACK FEATURES\r\nThis Helvetica backpack is hand flocked in the Medium Control studio. Flock is a printing method that results in a velvety textured graphic. This classic school style backpack has one large main compartment. A medium sized front zippered compartment, plus lightly padded adjustable back straps. Perfect for hauling around all your books, supplies and laptop. This backpack easily fits a 17" Macbook Pro Laptop. This 100% Nylon Cordura backpack is lightweight, durable, and comfortable !! \r\n\r\nSHOP THE MEDIUM CONTROL STORE\r\nhttp:\/\/etsy.com\/shop\/mediumcontrol\r\n\r\nSHOP FOR MORE BACKPACKS\r\nhttps:\/\/www.etsy.com\/shop\/mediumcontrol?section_id=5246993\r\n\r\nFRIENDS SAVE SOME CASH\r\nLike & Tweet & Pin & Share & Follow THE MEDIUM CONTROL on your favorite social media to SAVE 10%! After following us on one or all of our social media sites enter the coupon code FRIENDS10 to save some cash!\r\n\r\nLET'S BECOME FRIENDS \r\nI N S T A G R A M: http:\/\/instagram.com\/mediumcontrol\r\nF A C E B O O K: https:\/\/www.facebook.com\/mediumcontrol\r\nT W I T T E R: https:\/\/twitter.com\/mediumcontrol\r\nP I N T E R E S T: http:\/\/www.pinterest.com\/mediumcontrol", | |
"creation_tsz": 1427395846, | |
"ending_tsz": 1437936646, | |
"original_creation_tsz": 1351277644, | |
"last_modified_tsz": 1427395846, | |
"price": "46.00", | |
"currency_code": "USD", | |
"quantity": 4, | |
"tags": ["large backpack", "men backpack", "women backpack", "laptop backpack", "school backpack", "backpack", "typography", "backpacks", "rucksack for laptop", "womens backpack", "work bag for women", "travel backpack", "diaper bag backpack"], | |
"category_path": ["Bags and Purses", "Backpack"], | |
"category_path_ids": [69150455, 68888604], | |
"materials": ["nylon", "screenprint"], | |
"shop_section_id": 5246993, | |
"featured_rank": null, | |
"state_tsz": 1359768866, | |
"url": "https:\/\/www.etsy.com\/listing\/113244585\/backpack-helvetica-rucksack-typography?utm_source=producttemp&utm_medium=api&utm_campaign=api", | |
"views": 2580, | |
"num_favorers": 176, | |
"shipping_template_id": 5604011, | |
"processing_min": 3, | |
"processing_max": 5, | |
"who_made": "i_did", | |
"is_supply": "false", | |
"when_made": "made_to_order", | |
"item_weight": null, | |
"item_weight_units": null, | |
"item_length": null, | |
"item_width": null, | |
"item_height": null, | |
"item_dimensions_unit": null, | |
"is_private": false, | |
"recipient": "men", | |
"occasion": null, | |
"style": ["Minimalist", "Modern"], | |
"non_taxable": false, | |
"is_customizable": false, | |
"is_digital": false, | |
"file_data": "", | |
"language": "en-US", | |
"has_variations": true, | |
"suggested_taxonomy_id": 136, | |
"taxonomy_path": ["Bags & Purses", "Backpacks"], | |
"used_manufacturer": false, | |
"Variations": [ | |
{ | |
"property_id": 200, | |
"formatted_name": "Color", | |
"options": [{ | |
"value_id": 3068763992, | |
"value": "Smokey Gray Backpack", | |
"formatted_value": "Smokey Gray Backpack", | |
"is_available": true, | |
"price_diff": 0, | |
"price": 46 | |
}, { | |
"value_id": 3055110744, | |
"value": "Black Backpack", | |
"formatted_value": "Black Backpack", | |
"is_available": true, | |
"price_diff": 0, | |
"price": 46 | |
}] | |
} | |
], | |
"Images": [ | |
{ | |
"listing_image_id": 388880262, | |
"hex_code": "838484", | |
"red": 131, | |
"green": 132, | |
"blue": 132, | |
"hue": 180, | |
"saturation": 0, | |
"brightness": 51, | |
"is_black_and_white": false, | |
"creation_tsz": 1351277645, | |
"listing_id": 113244585, | |
"rank": 1, | |
"url_75x75": "https:\/\/img0.etsystatic.com\/006\/0\/5172521\/il_75x75.388880262_2ozb.jpg", | |
"url_170x135": "https:\/\/img0.etsystatic.com\/006\/0\/5172521\/il_170x135.388880262_2ozb.jpg", | |
"url_570xN": "https:\/\/img0.etsystatic.com\/006\/0\/5172521\/il_570xN.388880262_2ozb.jpg", | |
"url_fullxfull": "https:\/\/img0.etsystatic.com\/006\/0\/5172521\/il_fullxfull.388880262_2ozb.jpg", | |
"full_height": 860, | |
"full_width": 860 | |
}, { | |
"listing_image_id": 640232702, | |
"hex_code": "464446", | |
"red": 70, | |
"green": 68, | |
"blue": 70, | |
"hue": 300, | |
"saturation": 2, | |
"brightness": 27, | |
"is_black_and_white": false, | |
"creation_tsz": 1408045476, | |
"listing_id": 113244585, | |
"rank": 2, | |
"url_75x75": "https:\/\/img0.etsystatic.com\/036\/0\/5172521\/il_75x75.640232702_gbqx.jpg", | |
"url_170x135": "https:\/\/img0.etsystatic.com\/036\/0\/5172521\/il_170x135.640232702_gbqx.jpg", | |
"url_570xN": "https:\/\/img0.etsystatic.com\/036\/0\/5172521\/il_570xN.640232702_gbqx.jpg", | |
"url_fullxfull": "https:\/\/img0.etsystatic.com\/036\/0\/5172521\/il_fullxfull.640232702_gbqx.jpg", | |
"full_height": 860, | |
"full_width": 860 | |
}, { | |
"listing_image_id": 265215045, | |
"hex_code": "C2C2C2", | |
"red": 194, | |
"green": 194, | |
"blue": 194, | |
"hue": 0, | |
"saturation": 0, | |
"brightness": 76, | |
"is_black_and_white": false, | |
"creation_tsz": 1351277645, | |
"listing_id": 113244585, | |
"rank": 3, | |
"url_75x75": "https:\/\/img1.etsystatic.com\/000\/0\/5172521\/il_75x75.265215045.jpg", | |
"url_170x135": "https:\/\/img1.etsystatic.com\/000\/0\/5172521\/il_170x135.265215045.jpg", | |
"url_570xN": "https:\/\/img1.etsystatic.com\/000\/0\/5172521\/il_570xN.265215045.jpg", | |
"url_fullxfull": "https:\/\/img1.etsystatic.com\/000\/0\/5172521\/il_fullxfull.265215045.jpg", | |
"full_height": 860, | |
"full_width": 860 | |
}, { | |
"listing_image_id": 265214965, | |
"hex_code": "BBBAB8", | |
"red": 187, | |
"green": 186, | |
"blue": 184, | |
"hue": 40, | |
"saturation": 1, | |
"brightness": 73, | |
"is_black_and_white": false, | |
"creation_tsz": 1351277645, | |
"listing_id": 113244585, | |
"rank": 4, | |
"url_75x75": "https:\/\/img1.etsystatic.com\/000\/0\/5172521\/il_75x75.265214965.jpg", | |
"url_170x135": "https:\/\/img1.etsystatic.com\/000\/0\/5172521\/il_170x135.265214965.jpg", | |
"url_570xN": "https:\/\/img1.etsystatic.com\/000\/0\/5172521\/il_570xN.265214965.jpg", | |
"url_fullxfull": "https:\/\/img1.etsystatic.com\/000\/0\/5172521\/il_fullxfull.265214965.jpg", | |
"full_height": 860, | |
"full_width": 860 | |
}, { | |
"listing_image_id": 265248602, | |
"hex_code": "C3C3C3", | |
"red": 195, | |
"green": 195, | |
"blue": 195, | |
"hue": 0, | |
"saturation": 0, | |
"brightness": 76, | |
"is_black_and_white": false, | |
"creation_tsz": 1351277645, | |
"listing_id": 113244585, | |
"rank": 5, | |
"url_75x75": "https:\/\/img0.etsystatic.com\/000\/0\/5172521\/il_75x75.265248602.jpg", | |
"url_170x135": "https:\/\/img0.etsystatic.com\/000\/0\/5172521\/il_170x135.265248602.jpg", | |
"url_570xN": "https:\/\/img0.etsystatic.com\/000\/0\/5172521\/il_570xN.265248602.jpg", | |
"url_fullxfull": "https:\/\/img0.etsystatic.com\/000\/0\/5172521\/il_fullxfull.265248602.jpg", | |
"full_height": 860, | |
"full_width": 860 | |
} | |
], | |
"MainImage": { | |
"listing_image_id": 388880262, | |
"hex_code": null, | |
"red": null, | |
"green": null, | |
"blue": null, | |
"hue": null, | |
"saturation": null, | |
"brightness": null, | |
"is_black_and_white": null, | |
"creation_tsz": null, | |
"listing_id": 113244585, | |
"rank": null, | |
"url_75x75": "https:\/\/img0.etsystatic.com\/006\/0\/5172521\/il_75x75.388880262_2ozb.jpg", | |
"url_170x135": "https:\/\/img0.etsystatic.com\/006\/0\/5172521\/il_170x135.388880262_2ozb.jpg", | |
"url_570xN": "https:\/\/img0.etsystatic.com\/006\/0\/5172521\/il_570xN.388880262_2ozb.jpg", | |
"url_fullxfull": "https:\/\/img0.etsystatic.com\/006\/0\/5172521\/il_fullxfull.388880262_2ozb.jpg", | |
"full_height": null, | |
"full_width": null | |
}, | |
"Shop": { | |
"shop_id": 5172521, | |
"shop_name": "mediumcontrol", | |
"user_id": 5172188, | |
"creation_tsz": 1180816393, | |
"title": "TShirts | Backpacks | Messenger Bags | Art Prints ", | |
"announcement": "Men's T-Shirts, Women's T-Shirts, Kid's T-Shirts, Birthday TShirts, Messenger Bags, Backpacks, and Art Prints. Screen Printed & Letterpress Art Prints. Plus, the iconic Watson the Cat collection. We love Designing & Printing TShirts, Bags and Art Prints! \r\n\r\nAll items are hand printed by us in our Duluth, Minnesota studio.\r\n\r\nFRIENDS SAVE SOME CASH\r\nLike & Tweet & Pin & Share & Follow THE MEDIUM CONTROL on your favorite social media to SAVE 10%! After following us on one or all of our social media sites enter the coupon code FRIENDS10 to save some cash! \r\n\r\nLET'S BECOME FRIENDS \r\nI N S T A G R A M: http:\/\/instagram.com\/mediumcontrol\r\nF A C E B O O K: http:\/\/www.facebook.com\/mediumcontrol\r\nT W I T T E R: http:\/\/twitter.com\/mediumcontrol\r\nP I N T E R E S T: http:\/\/www.pinterest.com\/mediumcontrol\r\n\r\nJOIN THE MEDIUM CONTROL\r\nFollow @mediumcontrol and tag #mediumcontrol \r\n\r\nVISIT THE MEDIUM CONTROL STUDIO:\r\n307 Canal Park Drive Duluth, MN 55802", | |
"currency_code": "USD", | |
"is_vacation": false, | |
"vacation_message": null, | |
"sale_message": "T H A N K - Y O U !\r\nWe know your excited to receive your new Medium Control goods! You will receive an email with your tracking number once your order has been shipped. In the meantime, if you have any questions \/ comments or concerns please contact us. CHEERS! \r\n\r\nJOIN THE MEDIUM CONTROL\r\nFollow @mediumcontrol and tag #mediumcontrol \r\n\r\nhttp:\/\/mediumcontrol.com\/", | |
"digital_sale_message": null, | |
"last_updated_tsz": 1434606570, | |
"listing_active_count": 739, | |
"login_name": "mediumcontrol", | |
"accepts_custom_requests": false, | |
"policy_welcome": "THANK YOU for exploring The Medium Control, much appreciated. \r\n\r\nWe will always try to resolve any issue with you during and after your purchase. If you have any concerns about your order please contact us BEFORE leaving feedback - we will always try our best to make you happy!\r\n\r\n- Kristy + Tommy\r\nThe Medium Control \r\nOwners \/ Designer \/ Printers \/ Customer Service \/ Humans", | |
"policy_payment": "PAYMENT\r\nWe accept all major credit cards via Etsy direct check-out or payments issued thru Paypal. \r\n\r\nHere is a helpful Paypal tutorial: http:\/\/www.etsy.com\/storque\/how-to\/how-to-pay-with-a-credit-card-and-create-a-paypal-account-746\/ \r\n", | |
"policy_shipping": "We do our very best to ship all orders within 3-5 business days. However, if you need something sooner please let us know and we can usually make it happen! \r\n\r\nDOMESTIC SHIPPING\r\nAll orders 13-ounces and under will be shipped via USPS First Class mail. These orders usually arrive within 2-5 mailing days after shipment. All orders over 13-ounces will be shipped via USPS Priority Mail. These orders usually arrive within 2-3 mailing days after shipment. Express mail is available upon request. \r\n\r\nINTERNATIONAL SHIPPING \r\nInternational orders 4-pounds and under (most of our goods) are shipped via USPS First Class International mail. These orders usually arrive within 10-20 mailing days after shipment. All orders over 4-pounds will be shipped via USPS Priority mail. These orders usually arrive within 6-12 mailing days after shipment. \r\n\r\nNOTE: These timeframes are approximations based upon our shipping experience. However, sometimes your order may take longer if it is delayed by customs. Sorry, we can't live close to everybody! \r\n\r\nIMPORTANT NOTICE FOR INTERNATIONAL CUSTOMERS: Medium Control cannot be responsible for custom duties, import tariffs, taxes, and fees. Please be aware that you may be required to pay these additional charges when the package reaches your country. UK CUSTOMERS: The United Kingdom almost always charges local taxes and custom fees. We are unable to determine these fees and such fees are not covered by the amount paid to us for shipping. If you have any question about such fees it is best to consult with your local post office before ordering. \r\n\r\nLOST ORDERS AND\/OR INCORRECT ADDRESS\r\nWe ship all domestic orders with "Delivery Confirmation" service to your Etsy shipping address. If an item becomes trackably lost in the mail we will replace or refund the item, subject to availability, at our expense. However, if an item is shown as "Delivered" by USPS, we are unable to replace that item or provide a refund as "Delivered" status serves as guaranteed confirmation and receipt. However, with all that being said if you believe your order has been lost and\/or delivered to an incorrect address please let us know. ", | |
"policy_refunds": "EXCHANGE \/ RETURN PROCEDURE\r\nWe hope you happy with your goods but if your not then please notify us either by etsy convo or email ("[email protected]") of your intent to exchange \/ return the goods. \r\n\r\nEXCHANGE PROCEDURE: Please notify us 72 hours after receiving the goods of your intent to exchange. All returns\/exchanges must be verified by us via email before the item is mailed back. The return exchage shipping charge is paid for by you and we pay to ship the exchange item back to you. All exchanges items must be sent back within 14 days from the initial email communication. \r\n\r\nRETURN PROCEDURE: Please notify us 72 hours after receiving the goods of your intent to return. All returns\/exchanges must be verified by us via email before the item is mailed back. You must pay the return shipping cost. A refund will be issued ONLY for your the purchase price, your original shipping charge will NOT be refunded. All returns must be sent back to us within 14 days from the initial email communication. \r\n\r\nNOT ACCEPTABLE EXCHANGE \/ RETURN ITEMS: \r\n1. Limited edition prints\r\n2. Garments worn and\/or washed are not acceptable returns. Shrinkage due to washing is not a defect and is not an acceptable return. \r\n3. Backpacks or Bags used and\/or worn. \r\n4. Items in your possession for longer than 14 days. ", | |
"policy_additional": null, | |
"policy_seller_info": "QUESTIONS:\r\n"[email protected]"\r\n\r\nMAILING ADDRESS: \r\nMedium Control \r\nPO Box 3422\r\nDuluth, MN 55803\r\n", | |
"policy_updated_tsz": 1432753335, | |
"vacation_autoreply": "greetings\r\n---\r\nthe medium control people are out camping in the woods for a couple days...so no internet or email. we will back in the shop bright and early to talk to you on monday july 27. \r\n---\r\nthanks again for exploring the medium control\r\n---\r\nkristy", | |
"url": "https:\/\/www.etsy.com\/shop\/mediumcontrol?utm_source=producttemp&utm_medium=api&utm_campaign=api", | |
"image_url_760x100": "https:\/\/img0.etsystatic.com\/025\/0\/5172521\/iusb_760x100.13235056_s9ah.jpg", | |
"num_favorers": 13792, | |
"languages": ["en-US"], | |
"upcoming_local_event_id": null, | |
"User": { | |
"user_id": 5172188, | |
"login_name": "mediumcontrol", | |
"creation_tsz": 1282246995, | |
"user_pub_key": { | |
"key": "-----BEGIN PUBLIC KEY-----\nMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAvw7p7wP1gZUHZl8vnDGi\n\/SxPaQ+pJKRCgthoIhwDKRAQ5Q9t5gyGRhaY\/YMHz+Uze7SOlXsXRLrIT9fVfdjN\n7Yyp53xElZwovnn8utigsyUBIRDU+HK+SiRPBGfKY0FKCjhLobzDd0VKfAn9sMEK\nFFdETreagXGFO05KA0wOkBAAEPjKDQKvGjZXp4UPWx+xtdVYO7v1zlszud2sfZXe\n506M4e6e9ZloP8q3TGqkCJBCzQaneom05OmwEOLywNM5erHQbdvZ+IHFPzHsRr0Y\nO2cXZK0aX+71WDStPBzci76InrInHoMy5y\/Y48qEfYpzmWN64aN0oci7++UrAJsi\nKL8KwXBkuALYoRaKjuvEeAXQSRjmuwmOLnNHhvNjyejxv4vqEi2DecF6PWLUPhI4\n1NpjMROpVCsERC4ciz4H5dyWtx4n+jLe44f3EiAZHFM2iWjUsy5gnTBgS5SM6m1T\nUuzRP00zVmD0\/+IzmQ6dc33C5ugxrXtjC5qZaeh5NxCUchNSIdZ7NcSC72+dm3Ew\ny1zODORP1+mV96cTCXsd3oGxIdCoot447RuNY++17bwTCLN5DcDOkQskt0j+hDdr\nGbYtTMME2CRotEWC\/6LcbvET36eOw6cllFSfCS3CU7EGKiE3bDY8d7o5J+gU8wsc\n8lzEaRKE7LiI8Js1lJ00wgcCAwEAAQ==\n-----END PUBLIC KEY-----\n", | |
"key_id": 21377414845 | |
}, | |
"referred_by_user_id": null, | |
"feedback_info": { | |
"count": 3266, | |
"score": 100 | |
} | |
} | |
} | |
} | |
], | |
"params": { | |
"listing_id": "113244585" | |
}, | |
"type": "Listing", | |
"pagination": {} | |
} |
Thank you for the info, today's discussion was really helpful. On curl-listing.sh, I tried the curl command provided and it was being rejected. I proceeded to add the appropriate version (v2), an "s" to "listing", removed the .json
extension and my request was accepted.
$ curl -XGET https://openapi.etsy.com/v2/listings/113244585 \
--get -d api_key=REDACTED \
-d includes=Variations,Images,MainImage,Shop,Shop/User
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Try replacing the URL for the Etsy API in my
curl
command withhttp://httpbin.org/get
to see. Check out http://httpbin.org/ for more information.