├── code examples ├── etsy_curl.sh ├── etsy_python.py ├── etsy_nodejs.js ├── etsy_php.php ├── etsy_golang.go ├── etsy_csharp.cs └── etsy_java.java └── README.md /code examples/etsy_curl.sh: -------------------------------------------------------------------------------- 1 | curl --user user:pass \ 2 | 'https://realtime.oxylabs.io/v1/queries' \ 3 | -H "Content-Type: application/json" \ 4 | -d '{"source": "universal_ecommerce", "url": "https://www.etsy.com/listing/524233279/tiny-silver-forget-me-not-earrings", "geo_location": "United States","parse": true}' -------------------------------------------------------------------------------- /code examples/etsy_python.py: -------------------------------------------------------------------------------- 1 | import requests 2 | from pprint import pprint 3 | 4 | # Structure payload. 5 | payload = { 6 | 'source': 'universal_ecommerce', 7 | 'url': 'https://www.etsy.com/listing/524233279/tiny-silver-forget-me-not-earrings', 8 | 'geo_location': 'United States', 9 | 'parse': True, 10 | } 11 | 12 | # Get response. 13 | response = requests.request( 14 | 'POST', 15 | 'https://realtime.oxylabs.io/v1/queries', 16 | auth=('user', 'pass1'), 17 | json=payload, 18 | ) 19 | 20 | # Instead of response with job status and results url, this will return the 21 | # JSON response with the result. 22 | pprint(response.json()) -------------------------------------------------------------------------------- /code examples/etsy_nodejs.js: -------------------------------------------------------------------------------- 1 | import fetch from 'node-fetch'; 2 | 3 | const username = 'YOUR_USERNAME'; 4 | const password = 'YOUR_PASSWORD'; 5 | const body = { 6 | 'source': 'universal_ecommerce', 7 | 'url': 'https://www.etsy.com/listing/524233279/tiny-silver-forget-me-not-earrings', 8 | 'geo_location': 'United States', 9 | 'parse': true 10 | }; 11 | const response = await fetch('https://realtime.oxylabs.io/v1/queries', { 12 | method: 'post', 13 | body: JSON.stringify(body), 14 | headers: { 15 | 'Content-Type': 'application/json', 16 | 'Authorization': 'Basic ' + Buffer.from(`${username}:${password}`).toString('base64'), 17 | } 18 | }); 19 | 20 | console.log(await response.json()); -------------------------------------------------------------------------------- /code examples/etsy_php.php: -------------------------------------------------------------------------------- 1 | 'universal_ecommerce', 5 | 'url' => 'https://www.etsy.com/listing/524233279/tiny-silver-forget-me-not-earrings', 6 | 'geo_location' => 'United States', 7 | 'parse' => true 8 | ]; 9 | 10 | $ch = curl_init(); 11 | 12 | curl_setopt($ch, CURLOPT_URL, "https://realtime.oxylabs.io/v1/queries"); 13 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 14 | curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params)); 15 | curl_setopt($ch, CURLOPT_POST, 1); 16 | curl_setopt($ch, CURLOPT_USERPWD, "user" . ":" . "pass1"); 17 | 18 | $headers = array(); 19 | $headers[] = "Content-Type: application/json"; 20 | curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 21 | 22 | $result = curl_exec($ch); 23 | echo $result; 24 | 25 | if (curl_errno($ch)) { 26 | echo 'Error:' . curl_error($ch); 27 | } 28 | curl_close ($ch); 29 | ?> -------------------------------------------------------------------------------- /code examples/etsy_golang.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "bytes" 5 | "encoding/json" 6 | "fmt" 7 | "io/ioutil" 8 | "net/http" 9 | ) 10 | 11 | func main() { 12 | const Username = "YOUR_USERNAME" 13 | const Password = "YOUR_PASSWORD" 14 | 15 | payload := map[string]string{ 16 | "source": "universal_ecommerce", 17 | "url": "https://www.etsy.com/listing/524233279/tiny-silver-forget-me-not-earrings", 18 | "geo_location": "United States", 19 | "parse": true, 20 | } 21 | 22 | jsonValue, _ := json.Marshal(payload) 23 | 24 | client := &http.Client{} 25 | request, _ := http.NewRequest("POST", 26 | "https://realtime.oxylabs.io/v1/queries", 27 | bytes.NewBuffer(jsonValue), 28 | ) 29 | 30 | request.SetBasicAuth(Username, Password) 31 | response, _ := client.Do(request) 32 | 33 | responseText, _ := ioutil.ReadAll(response.Body) 34 | fmt.Println(string(responseText)) 35 | } -------------------------------------------------------------------------------- /code examples/etsy_csharp.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Net.Http; 4 | using System.Net.Http.Json; 5 | using System.Threading.Tasks; 6 | 7 | namespace OxyApi 8 | { 9 | class Program 10 | { 11 | static async Task Main() 12 | { 13 | const string Username = "YOUR_USERNAME"; 14 | const string Password = "YOUR_PASSWORD"; 15 | 16 | var parameters = new Dictionary() 17 | { 18 | { "source", "universal_ecommerce" }, 19 | { "url", "https://www.etsy.com/listing/524233279/tiny-silver-forget-me-not-earrings" }, 20 | { "geo_location" : "United States" }, 21 | { "parse", true }, 22 | }; 23 | 24 | 25 | var client = new HttpClient(); 26 | 27 | Uri baseUri = new Uri("https://realtime.oxylabs.io"); 28 | client.BaseAddress = baseUri; 29 | 30 | var requestMessage = new HttpRequestMessage(HttpMethod.Post, "/v1/queries"); 31 | requestMessage.Content = JsonContent.Create(parameters); 32 | 33 | var authenticationString = $"{Username}:{Password}"; 34 | var base64EncodedAuthenticationString = Convert.ToBase64String(System.Text.ASCIIEncoding.UTF8.GetBytes(authenticationString)); 35 | requestMessage.Headers.Add("Authorization", "Basic " + base64EncodedAuthenticationString); 36 | 37 | var response = await client.SendAsync(requestMessage); 38 | var contents = await response.Content.ReadAsStringAsync(); 39 | 40 | Console.WriteLine(contents); 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /code examples/etsy_java.java: -------------------------------------------------------------------------------- 1 | import okhttp3.*; 2 | import org.json.JSONObject; 3 | 4 | public class Main implements Runnable { 5 | private static final String AUTHORIZATION_HEADER = "Authorization"; 6 | public static final String USERNAME = "YOUR_USERNAME"; 7 | public static final String PASSWORD = "YOUR_PASSWORD"; 8 | 9 | public void run() { 10 | JSONObject jsonObject = new JSONObject(); 11 | jsonObject.put("source", "universal_ecommerce"); 12 | jsonObject.put("url", "https://www.etsy.com/listing/524233279/tiny-silver-forget-me-not-earrings"); 13 | jsonObject.put("geo_location", "United States"); 14 | jsonObject.put("parse", true); 15 | 16 | Authenticator authenticator = (route, response) -> { 17 | String credential = Credentials.basic(USERNAME, PASSWORD); 18 | 19 | return response 20 | .request() 21 | .newBuilder() 22 | .header(AUTHORIZATION_HEADER, credential) 23 | .build(); 24 | }; 25 | 26 | var client = new OkHttpClient.Builder() 27 | .authenticator(authenticator) 28 | .build(); 29 | 30 | var mediaType = MediaType.parse("application/json; charset=utf-8"); 31 | var body = RequestBody.create(jsonObject.toString(), mediaType); 32 | var request = new Request.Builder() 33 | .url("https://realtime.oxylabs.io/v1/queries") 34 | .post(body) 35 | .build(); 36 | 37 | try (var response = client.newCall(request).execute()) { 38 | assert response.body() != null; 39 | System.out.println(response.body().string()); 40 | } catch (Exception exception) { 41 | System.out.println("Error: " + exception.getMessage()); 42 | } 43 | 44 | System.exit(0); 45 | } 46 | 47 | public static void main(String[] args) { 48 | new Thread(new Main()).start(); 49 | } 50 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Etsy Scraper 2 | 3 | [![Oxylabs promo code](https://raw.githubusercontent.com/oxylabs/product-integrations/refs/heads/master/Affiliate-Universal-1090x275.png)](https://oxylabs.io/pages/gitoxy?utm_source=877&utm_medium=affiliate&groupid=877&utm_content=etsy-scraper-github&transaction_id=102f49063ab94276ae8f116d224b67) 4 | 5 | 6 | [![](https://dcbadge.vercel.app/api/server/eWsVUJrnG5)](https://discord.com/invite/Pds3gBmKMH) 7 | 8 | Oxylabs’[ Etsy Scraper](https://oxy.yt/Vafh) is a data gathering solution allowing you to extract real-time information from an Etsy website effortlessly. This brief guide explains how an Etsy Scraper works and provides code examples to understand better how you can use it hassle-free. 9 | 10 | ### How it works 11 | 12 | You can get Etsy results by providing your own URLs to our service. We can return the HTML for any Etsy page you like. Additionally, we can deliver structured (parsed) JSON output or Markdown format results for Etsy product pages. 13 | 14 | #### Python code example 15 | 16 | The example below illustrates how you can get a parsed Etsy product page result. 17 | 18 | ```python 19 | import requests 20 | from pprint import pprint 21 | 22 | # Structure payload. 23 | payload = { 24 | 'source': 'universal', 25 | 'url': 'https://www.etsy.com/listing/524233279/tiny-silver-forget-me-not-earrings', 26 | 'geo_location': 'United States', 27 | 'parse': True, 28 | } 29 | 30 | # Get response. 31 | response = requests.request( 32 | 'POST', 33 | 'https://realtime.oxylabs.io/v1/queries', 34 | auth=('user', 'pass1'), 35 | json=payload, 36 | ) 37 | 38 | # Instead of response with job status and results url, this will return the 39 | # JSON response with the result. 40 | pprint(response.json()) 41 | ``` 42 | 43 | Find code examples for other programming languages [**here**](https://github.com/oxylabs/etsy-scraper/tree/main/code%20examples) 44 | 45 | #### Output Example 46 | ```json 47 | { 48 | "results": [ 49 | { 50 | "content": { 51 | "url": "https://www.etsy.com/listing/524233279/tiny-silver-forget-me-not-earrings?click_key=dee3e777ad5cc36010f708a8991825c7d84649b8:524233279&click_sum=2cca2059&ref=hp_rv-3&sts=1", 52 | "price": 29.48, 53 | "title": "Tiny silver Forget me Not earrings. Dainty sterling threader earrings with light blue enameled blossom. Threader Stud earring for her.", 54 | "images": [ 55 | "https://i.etsystatic.com/6401969/r/il/b84458/1226050351/il_75x75.1226050351_kvdw.jpg", 56 | "https://i.etsystatic.com/6401969/c/1066/847/58/71/il/064963/1226057237/il_75x75.1226057237_q5jf.jpg", 57 | "https://i.etsystatic.com/6401969/r/il/d68e0d/1226050373/il_75x75.1226050373_6u24.jpg", 58 | "https://i.etsystatic.com/6401969/r/il/b71cfc/1226050549/il_75x75.1226050549_29un.jpg", 59 | "https://i.etsystatic.com/6401969/r/il/fe8682/1178831922/il_75x75.1178831922_k9ny.jpg" 60 | ], 61 | "seller": { 62 | "url": "https://www.etsy.com/shop/VillaSorgenfrei?ref=simple-shop-header-name&listing_id=524233279", 63 | "title": "VillaSorgenfrei", 64 | "rating": 4.8636, 65 | "star_seller": true, 66 | "reviews_count": 34115 67 | }, 68 | "reviews": { 69 | "count": 258 70 | }, 71 | "currency": "USD", 72 | "shipping": { 73 | "from": "Germany" 74 | }, 75 | "categories": [ 76 | { 77 | "title": "All categories" 78 | }, 79 | { 80 | "title": "Jewelry" 81 | }, 82 | { 83 | "title": "Earrings" 84 | }, 85 | { 86 | "title": "Stud Earrings" 87 | } 88 | ], 89 | "product_id": "524233279", 90 | "stock_status": "Low in stock", 91 | "variation_count": 1, 92 | "parse_status_code": 12000 93 | }, 94 | "created_at": "2022-11-17 14:45:28", 95 | "updated_at": "2022-11-17 14:45:33", 96 | "page": 1, 97 | "url": "https://www.etsy.com/listing/524233279/tiny-silver-forget-me-not-earrings?click_key=dee3e777ad5cc36010f708a8991825c7d84649b8:524233279&click_sum=2cca2059&ref=hp_rv-3&sts=1", 98 | "job_id": "6999019685052180481", 99 | "status_code": 200, 100 | "parser_type": "etsy_product" 101 | } 102 | ] 103 | } 104 | ``` 105 | 106 | With our Etsy Scraper, you can effortlessly extract public data from any Etsy web page. Collect the required product information, such as price, reviews, or descriptions, to analyze the market and stay ahead of your competitors. If you have any questions, contact our support team via live chat or email us at hello@oxylabs.io. 107 | 108 | Also, check this tutorial on [pypi](https://pypi.org/project/etsy-scraper-api/) 109 | --------------------------------------------------------------------------------