├── code examples ├── zara_curl.sh ├── zara_python.py ├── zara_nodejs.js ├── zara_php.php ├── zara_golang.go ├── zara_csharp.cs └── zara_java.java └── README.md /code examples/zara_curl.sh: -------------------------------------------------------------------------------- 1 | curl --user user:pass \ 2 | 'https://realtime.oxylabs.io/v1/queries' \ 3 | -H "Content-Type: application/json" \ 4 | -d '{"source": "universal", "url": "https://www.zara.com/ww/en/woman-blazers-l1055.html?v1=2290737"}' -------------------------------------------------------------------------------- /code examples/zara_python.py: -------------------------------------------------------------------------------- 1 | import requests 2 | from pprint import pprint 3 | 4 | # Structure payload. 5 | payload = { 6 | 'source': 'universal', 7 | 'url': 'https://www.zara.com/ww/en/woman-blazers-l1055.html?v1=2290737' 8 | } 9 | 10 | # Get response. 11 | response = requests.request( 12 | 'POST', 13 | 'https://realtime.oxylabs.io/v1/queries', 14 | auth=('user', 'pass1'), 15 | json=payload, 16 | ) 17 | 18 | # Instead of response with job status and results url, this will return the 19 | # JSON response with the result. 20 | pprint(response.json()) -------------------------------------------------------------------------------- /code examples/zara_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', 7 | 'url': 'https://www.zara.com/ww/en/woman-blazers-l1055.html?v1=2290737'}; 8 | 9 | const response = await fetch('https://realtime.oxylabs.io/v1/queries', { 10 | method: 'post', 11 | body: JSON.stringify(body), 12 | headers: { 13 | 'Content-Type': 'application/json', 14 | 'Authorization': 'Basic ' + Buffer.from(`${username}:${password}`).toString('base64'), 15 | } 16 | }); 17 | 18 | console.log(await response.json()); -------------------------------------------------------------------------------- /code examples/zara_php.php: -------------------------------------------------------------------------------- 1 | 'universal', 5 | 'url' => 'https://www.zara.com/ww/en/woman-blazers-l1055.html?v1=2290737']; 6 | 7 | $ch = curl_init(); 8 | 9 | curl_setopt($ch, CURLOPT_URL, "https://realtime.oxylabs.io/v1/queries"); 10 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 11 | curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params)); 12 | curl_setopt($ch, CURLOPT_POST, 1); 13 | curl_setopt($ch, CURLOPT_USERPWD, "user" . ":" . "pass1"); 14 | 15 | $headers = array(); 16 | $headers[] = "Content-Type: application/json"; 17 | curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 18 | 19 | $result = curl_exec($ch); 20 | echo $result; 21 | 22 | if (curl_errno($ch)) { 23 | echo 'Error:' . curl_error($ch); 24 | } 25 | curl_close ($ch); 26 | ?> -------------------------------------------------------------------------------- /code examples/zara_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", 17 | "url": "https://www.zara.com/ww/en/woman-blazers-l1055.html?v1=2290737", 18 | } 19 | 20 | jsonValue, _ := json.Marshal(payload) 21 | 22 | client := &http.Client{} 23 | request, _ := http.NewRequest("POST", 24 | "https://realtime.oxylabs.io/v1/queries", 25 | bytes.NewBuffer(jsonValue), 26 | ) 27 | 28 | request.SetBasicAuth(Username, Password) 29 | response, _ := client.Do(request) 30 | 31 | responseText, _ := ioutil.ReadAll(response.Body) 32 | fmt.Println(string(responseText)) 33 | } -------------------------------------------------------------------------------- /code examples/zara_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" }, 19 | { "url", "https://www.zara.com/ww/en/woman-blazers-l1055.html?v1=2290737"}, 20 | } 21 | 22 | 23 | var client = new HttpClient(); 24 | 25 | Uri baseUri = new Uri("https://realtime.oxylabs.io"); 26 | client.BaseAddress = baseUri; 27 | 28 | var requestMessage = new HttpRequestMessage(HttpMethod.Post, "/v1/queries"); 29 | requestMessage.Content = JsonContent.Create(parameters); 30 | 31 | var authenticationString = $"{Username}:{Password}"; 32 | var base64EncodedAuthenticationString = Convert.ToBase64String(System.Text.ASCIIEncoding.UTF8.GetBytes(authenticationString)); 33 | requestMessage.Headers.Add("Authorization", "Basic " + base64EncodedAuthenticationString); 34 | 35 | var response = await client.SendAsync(requestMessage); 36 | var contents = await response.Content.ReadAsStringAsync(); 37 | 38 | Console.WriteLine(contents); 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /code examples/zara_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"); 12 | jsonObject.put("url", "https://www.zara.com/ww/en/woman-blazers-l1055.html?v1=2290737"); 13 | 14 | Authenticator authenticator = (route, response) -> { 15 | String credential = Credentials.basic(USERNAME, PASSWORD); 16 | 17 | return response 18 | .request() 19 | .newBuilder() 20 | .header(AUTHORIZATION_HEADER, credential) 21 | .build(); 22 | }; 23 | 24 | var client = new OkHttpClient.Builder() 25 | .authenticator(authenticator) 26 | .build(); 27 | 28 | var mediaType = MediaType.parse("application/json; charset=utf-8"); 29 | var body = RequestBody.create(jsonObject.toString(), mediaType); 30 | var request = new Request.Builder() 31 | .url("https://realtime.oxylabs.io/v1/queries") 32 | .post(body) 33 | .build(); 34 | 35 | try (var response = client.newCall(request).execute()) { 36 | assert response.body() != null; 37 | System.out.println(response.body().string()); 38 | } catch (Exception exception) { 39 | System.out.println("Error: " + exception.getMessage()); 40 | } 41 | 42 | System.exit(0); 43 | } 44 | 45 | public static void main(String[] args) { 46 | new Thread(new Main()).start(); 47 | } 48 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Zara Scraper API 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=zara-scraper-github&transaction_id=102f49063ab94276ae8f116d224b67) 4 | 5 | 6 | [![](https://dcbadge.limes.pink/api/server/Pds3gBmKMH?style=for-the-badge&theme=discord)](https://discord.gg/Pds3gBmKMH) [![YouTube](https://img.shields.io/badge/YouTube-Oxylabs-red?style=for-the-badge&logo=youtube&logoColor=white)](https://www.youtube.com/@oxylabs) 7 | 8 | Oxylabs’ [Zara Scraper](https://oxylabs.io/products/scraper-api/ecommerce/zara?utm_source=github&utm_medium=repositories&utm_campaign=product) is a data gathering solution allowing you to extract real-time information from an Zara website effortlessly. This brief guide explains how an Zara 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 Zara results by providing your own URLs to our service. We can return the HTML for any Zara page you like. 13 | 14 | #### Python code example 15 | 16 | The example below illustrates how you can get HTML of Zara page. 17 | 18 | ```python 19 | import requests 20 | from pprint import pprint 21 | 22 | # Structure payload. 23 | payload = { 24 | 'source': 'universal', 25 | 'url': 'https://www.zara.com/ww/en/woman-blazers-l1055.html?v1=2290737' 26 | } 27 | 28 | # Get response. 29 | response = requests.request( 30 | 'POST', 31 | 'https://realtime.oxylabs.io/v1/queries', 32 | auth=('user', 'pass1'), 33 | json=payload, 34 | ) 35 | 36 | # Instead of response with job status and results url, this will return the 37 | # JSON response with the result. 38 | pprint(response.json()) 39 | ``` 40 | Find code examples for other programming languages [**here**](https://github.com/oxylabs/zara-scraper/tree/main/code%20examples) 41 | 42 | #### Output Example 43 | ```json 44 | { 45 | "results": [ 46 | { 47 | "content": " ", 48 | "created_at": "2023-12-18 10:37:00", 49 | "updated_at": "2023-12-18 10:37:02", 50 | "page": 1, 51 | "url": "https://www.zara.com/ww/en/woman-blazers-l1055.html?v1=2290737", 52 | "job_id": "7142462752039115777", 53 | "status_code": 200 54 | } 55 | ] 56 | } 57 | ``` 58 | With our Zara Scraper, you can seamlessly gather data exclusive to Zara web pages. Take hold of crucial fashion detail, including clothing prices, user reviews, and garment descriptions, to evaluate the fashion market and stay on top of your competition. For any queries or troubleshooting guidance, feel free to connect with our support team through live chat or drop us an email at hello@oxylabs.io. 59 | --------------------------------------------------------------------------------