
Boulanger
Deprecated
Pricing
$100.00/month + usage

Boulanger
Deprecated
Extract information from boulanlger : simply provide your search URL (+ your filters and location). You will get the results easy, and fast
0.0 (0)
Pricing
$100.00/month + usage
1
Total users
6
Monthly users
1
Last modified
a year ago
You can access the Boulanger programmatically from your own applications by using the Apify API. You can also choose the language preference from below. To use the Apify API, you’ll need an Apify account and your API token, found in Integrations settings in Apify Console.
1import { ApifyClient } from 'apify-client';2
3// Initialize the ApifyClient with your Apify API token4// Replace the '<YOUR_API_TOKEN>' with your token5const client = new ApifyClient({6 token: '<YOUR_API_TOKEN>',7});8
9// Prepare Actor input10const input = {11 "startUrls": [12 {13 "url": "https://www.boulanger.com/resultats?tr=samsung"14 }15 ],16 "pageFunction": async function pageFunction(context) {17 let data = {}18 let userData = context.request.userData19 data.url = context.request.url20 data.label = userData.label21 22 let items = await context.page.evaluate(() => {23 const item = $('.product-item')24 // const item = $('.rm-product')25 const itemInfo = item.map(function(i,elem) {26 let obj = {}27 obj.title = $(this).find('h2').text()28 obj.sponsored = false29 obj.price = $(this).find('.price__amount').text()30 obj.img = $(this).find('img').attr('src')31 obj.rank = i+132 return obj33 }).get()34 35 const itemSponsored = $('.rm-product')36 const itemInfoSponsored = itemSponsored.map(function(i,elem) {37 let obj = {}38 obj.title = $(this).find('h2').text()39 obj.sponsored = true40 obj.price = $(this).find('.rm_price').text()41 obj.img = $(this).find('img').attr('src')42 obj.rank = i+143 return obj44 }).get()45 46 // return [...itemInfo,...itemInfoSponsored]47 const allitems = itemInfoSponsored.concat(itemInfo)48 return allitems49 })50 51 let itemsWithDataProp = items.map(obj => { 52 for(const key of Object.keys(data) ){53 obj[key] = data[key]54 }55 return obj56 })57 return itemsWithDataProp;58 },59 "proxyConfiguration": {60 "useApifyProxy": true,61 "apifyProxyGroups": [62 "RESIDENTIAL"63 ],64 "apifyProxyCountry": "FR"65 }66};67
68// Run the Actor and wait for it to finish69const run = await client.actor("anchor/boulanger").call(input);70
71// Fetch and print Actor results from the run's dataset (if any)72console.log('Results from dataset');73console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);74const { items } = await client.dataset(run.defaultDatasetId).listItems();75items.forEach((item) => {76 console.dir(item);77});78
79// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs
Boulanger API in JavaScript
The Apify API client for JavaScript is the official library that allows you to use Boulanger API in JavaScript or TypeScript, providing convenience functions and automatic retries on errors.
Install the apify-client
$npm install apify-client
Other API clients include: