diff --git a/lib/provider/immoscout.js b/lib/provider/immoscout.js index 99146eb..f1cf7ba 100644 --- a/lib/provider/immoscout.js +++ b/lib/provider/immoscout.js @@ -3,7 +3,7 @@ * * The mobile API provides the following endpoints: * - GET /search/total?{search parameters}: Returns the total number of listings for the given query - * Example: `curl -H "User-Agent: ImmoScout24_1410_30_._" https://api.mobile.immobilienscout24.de/search/total?searchType=region&realestatetype=apartmentrent&pricetype=calculatedtotalrent&geocodes=%2Fde%2Fberlin%2Fberlin ` + * Example: `curl -H "User-Agent: ImmoScout_27.3_26.0_._" https://api.mobile.immobilienscout24.de/search/total?searchType=region&realestatetype=apartmentrent&pricetype=calculatedtotalrent&geocodes=%2Fde%2Fberlin%2Fberlin ` * * - POST /search/list?{search parameters}: Actually retrieves the listings. Body is json encoded and contains * data specifying additional results (advertisements) to return. The format is as follows: @@ -15,12 +15,12 @@ * ``` * It is not necessary to provide data for the specified keys. * - * Example: `curl -X POST 'https://api.mobile.immobilienscout24.de/search/list?pricetype=calculatedtotalrent&realestatetype=apartmentrent&searchType=region&geocodes=%2Fde%2Fberlin%2Fberlin&pagenumber=1' -H "Connection: keep-alive" -H "User-Agent: ImmoScout24_1410_30_._" -H "Accept: application/json" -H "Content-Type: application/json" -d '{"supportedResultListType": [], "userData": {}}'` + * Example: `curl -X POST 'https://api.mobile.immobilienscout24.de/search/list?pricetype=calculatedtotalrent&realestatetype=apartmentrent&searchType=region&geocodes=%2Fde%2Fberlin%2Fberlin&pagenumber=1' -H "Connection: keep-alive" -H "User-Agent: ImmoScout_27.3_26.0_._" -H "Accept: application/json" -H "Content-Type: application/json" -d '{"supportedResultListType": [], "userData": {}}'` * - GET /expose/{id} - Returns the details of a listing. The response contains additional details not included in the * listing response. * - * Example: `curl -H "User-Agent: ImmoScout24_1410_30_._" "https://api.mobile.immobilienscout24.de/expose/158382494"` + * Example: `curl -H "User-Agent: ImmoScout_27.3_26.0_._" "https://api.mobile.immobilienscout24.de/expose/158382494"` * * * It is necessary to set the correct User Agent (see `getListings`) in the request header. @@ -44,7 +44,7 @@ async function getListings(url) { const response = await fetch(url, { method: 'POST', headers: { - 'User-Agent': 'ImmoScout24_1410_30_._', + 'User-Agent': 'ImmoScout_27.3_26.0_._', 'Content-Type': 'application/json', }, body: JSON.stringify({ diff --git a/package.json b/package.json index 334ebf6..cb7d34a 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fredy", - "version": "12.1.1", + "version": "12.1.2", "description": "[F]ind [R]eal [E]states [d]amn eas[y].", "scripts": { "prepare": "husky", diff --git a/reverse-engineered-immoscout.md b/reverse-engineered-immoscout.md index 99e311c..2286cd8 100644 --- a/reverse-engineered-immoscout.md +++ b/reverse-engineered-immoscout.md @@ -41,7 +41,7 @@ Challenges: _Returns the total number of listings for the given query._ ``` -curl -H "User-Agent: ImmoScout24_1410_30_._" \ +curl -H "User-Agent: ImmoScout_27.3_26.0_._" \ -H "Accept: application/json" \ "https://api.mobile.immobilienscout24.de/search/total?searchType=region&realestatetype=apartmentrent&pricetype=calculatedtotalrent&geocodes=%2Fde%2Fberlin%2Fberlin" ``` @@ -63,7 +63,7 @@ _The body is json encoded and contains data specifying additional results (adver ``` curl -X POST 'https://api.mobile.immobilienscout24.de/search/list?pricetype=calculatedtotalrent&realestatetype=apartmentrent&searchType=region&geocodes=%2Fde%2Fberlin%2Fberlin&pagenumber=1' \ -H "Connection: keep-alive" \ - -H "User-Agent: ImmoScout24_1410_30_._" \ + -H "User-Agent: ImmoScout_27.3_26.0_._" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -d '{"supportedResultListType":[],"userData":{}}' @@ -78,7 +78,7 @@ curl -X POST 'https://api.mobile.immobilienscout24.de/search/list?pricetype=calc The response contains additional details not included in the listing response. ``` -curl -H "User-Agent: ImmoScout24_1410_30_._" \ +curl -H "User-Agent: ImmoScout_27.3_26.0_._" \ -H "Accept: application/json" \ "https://api.mobile.immobilienscout24.de/expose/158382494" ``` diff --git a/test/services/immoscout/immoscout-web-translator.test.js b/test/services/immoscout/immoscout-web-translator.test.js index 1966ef9..e680236 100644 --- a/test/services/immoscout/immoscout-web-translator.test.js +++ b/test/services/immoscout/immoscout-web-translator.test.js @@ -53,7 +53,7 @@ describe('#immoscout-mobile URL conversion', () => { const response = await fetch(url, { method: 'POST', headers: { - 'User-Agent': 'ImmoScout24_1410_30_._', + 'User-Agent': 'ImmoScout_27.3_26.0_._', 'Content-Type': 'application/json', }, body: JSON.stringify({