@rent-scraper/api 1.0.31 → 1.0.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,3 +1,31 @@
1
1
  # @rent-scraper/api
2
2
 
3
- API to scrape data from rental listings
3
+ Internal package. Provides scraping functions and config accessors for Zillow and Redfin, used by `@rent-scraper/scrape-listings`.
4
+
5
+ ## Zillow
6
+
7
+ - **`waitForSolvedZillowCaptcha()`** — opens `zillow.com/homes/for_rent/` in the browser, polls until the page navigates cleanly (no captcha), then refreshes the cookie. Handles captcha automatically if it appears.
8
+ - **`waitForZillowCaptchaSolve()`** — aggressively reloads the page to force a PerimeterX captcha to appear, then auto-solves it. Used when `forceCaptcha: true` is set in config.
9
+ - **`isBrowserShowingCaptcha()`** — returns `true` if the browser's current page is showing a captcha challenge.
10
+ - **`getZillowListingResults()`** — fetches listing search results for a region via the Zillow API.
11
+ - **`getZillowListingDetailsByZpid()`** — fetches full listing details for a given `zpid`.
12
+ - **`getZillowRegionId()`** — resolves a zip code to a Zillow region ID.
13
+ - **`fetchHtmlFromZillowListingUrl()`** — fetches raw HTML for a listing detail page.
14
+
15
+ ### Config accessors (`config.ts`)
16
+
17
+ | Function | Config key |
18
+ | ------------------------- | -------------- |
19
+ | `getZillowCookie()` | `zillowCookie` |
20
+ | `getZillowDaysListed()` | `daysListed` |
21
+ | `getZillowForceCaptcha()` | `forceCaptcha` |
22
+ | `getZillowLimit()` | `limit` |
23
+ | `getZillowOffset()` | `offset` |
24
+ | `getZillowOutputPath()` | `outputPath` |
25
+ | `getZillowZipCodes()` | `zipCodes` |
26
+
27
+ ## Redfin
28
+
29
+ - **`getRedfinListingResults()`** — fetches listing results for a region.
30
+ - **`getRedfinListingDetails()`** — fetches listing detail HTML.
31
+ - **`getRedfinRegionId()`** — resolves a zip code to a Redfin region ID.
package/dist/config.d.mts CHANGED
@@ -1,16 +1,8 @@
1
- declare const getZillowCookie: () => Promise<string | null>;
2
- declare const getZillowDaysListed: () => Promise<string | null>;
3
- declare const getZillowAutoCaptcha: () => Promise<boolean | null>;
4
- declare const getZillowLimit: () => Promise<number | null>;
5
- declare const getZillowOffset: () => Promise<number | null>;
6
- declare const getZillowOutputPath: () => Promise<string>;
7
- declare const getZillowZipCodes: () => Promise<number[]>;
8
- type Zpid = string;
1
+ export { Z as Zpid, b as getZillowAutoCaptcha, g as getZillowCookie, a as getZillowDaysListed, c as getZillowForceCaptcha, d as getZillowLimit, e as getZillowOffset, f as getZillowOutputPath, h as getZillowZipCodes } from './shared/api.D_RFZ0x7.mjs';
9
2
 
10
3
  declare const getRedfinOutputPath: () => Promise<string>;
11
4
  declare const getRedfinZipCodes: () => Promise<number[]>;
12
5
  declare const getRedfinDaysListed: () => Promise<string | null>;
13
6
  declare const getRedfinCookie: () => Promise<string | null>;
14
7
 
15
- export { getRedfinCookie, getRedfinDaysListed, getRedfinOutputPath, getRedfinZipCodes, getZillowAutoCaptcha, getZillowCookie, getZillowDaysListed, getZillowLimit, getZillowOffset, getZillowOutputPath, getZillowZipCodes };
16
- export type { Zpid };
8
+ export { getRedfinCookie, getRedfinDaysListed, getRedfinOutputPath, getRedfinZipCodes };
package/dist/config.mjs CHANGED
@@ -1 +1 @@
1
- export{k as getRedfinCookie,j as getRedfinDaysListed,h as getRedfinOutputPath,i as getRedfinZipCodes,b as getZillowAutoCaptcha,g as getZillowCookie,a as getZillowDaysListed,c as getZillowLimit,d as getZillowOffset,e as getZillowOutputPath,f as getZillowZipCodes}from"./shared/api.DfAvAXsZ.mjs";import"@rent-scraper/utils/config";
1
+ export{l as getRedfinCookie,k as getRedfinDaysListed,i as getRedfinOutputPath,j as getRedfinZipCodes,b as getZillowAutoCaptcha,g as getZillowCookie,a as getZillowDaysListed,c as getZillowForceCaptcha,d as getZillowLimit,e as getZillowOffset,f as getZillowOutputPath,h as getZillowZipCodes}from"./shared/api.Bouw8I_6.mjs";import"@rent-scraper/utils/config";
package/dist/index.d.mts CHANGED
@@ -1,4 +1,5 @@
1
1
  import dayjs from 'dayjs';
2
+ export { Z as Zpid, b as getZillowAutoCaptcha, g as getZillowCookie, a as getZillowDaysListed, c as getZillowForceCaptcha, d as getZillowLimit, e as getZillowOffset, f as getZillowOutputPath, h as getZillowZipCodes } from './shared/api.D_RFZ0x7.mjs';
2
3
  import { ScreenshotOptions } from 'puppeteer';
3
4
 
4
5
  declare const getRedfinListingDetailsById: (id: string, url?: string) => Promise<any>;
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
- import h from"dayjs";import*as L from"cheerio";import{getValueFromConfigFile as M}from"@rent-scraper/utils/config";import{throwError as T,parseError as F,getRandomArrayValue as q}from"@rent-scraper/utils";import{k as K,g as b,f as Q,b as O}from"./shared/api.DfAvAXsZ.mjs";import c from"axios";import j from"puppeteer";const N=async(e,t)=>{const{fromFile:r=!0}=t??{};return r?(await M("redfin","regionIds"))[String(e)]??await P(e):await P(e)},g=e=>JSON.parse(e.replace("{}&&","")),P=async e=>{const t="https://www.redfin.com/stingray/do/rental-location-autocomplete",r={"Content-Type":"application/json; charset=utf-8","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"},o=`?location=${e}&v=2`;try{const a=`${t}${o}`,i=await(await fetch(a,{method:"GET",headers:r})).text(),s=g(i),{exactMatch:n}=s.payload||{},p=Number(n.id.replace(n.type,"").replace("_",""));return p||console.log("no region id found for zip"),p}catch{return console.log("zip code not found"),null}},J=async e=>({data:await R(e)}),H=async e=>{const t=await R(e);return v(t)},v=e=>{const t=L.load(e)('script:contains("ReactServerAgent.cache")').text()?.replace(`_tLAB.wait(function(){
1
+ import h from"dayjs";import*as M from"cheerio";import{getValueFromConfigFile as F}from"@rent-scraper/utils/config";import{throwError as T,parseError as O,getRandomArrayValue as K}from"@rent-scraper/utils";import{l as Q,g as A,h as N,b as P}from"./shared/api.Bouw8I_6.mjs";export{a as getZillowDaysListed,c as getZillowForceCaptcha,d as getZillowLimit,e as getZillowOffset,f as getZillowOutputPath}from"./shared/api.Bouw8I_6.mjs";import c from"axios";import j from"puppeteer";const H=async(e,t)=>{const{fromFile:r=!0}=t??{};return r?(await F("redfin","regionIds"))[String(e)]??await R(e):await R(e)},g=e=>JSON.parse(e.replace("{}&&","")),R=async e=>{const t="https://www.redfin.com/stingray/do/rental-location-autocomplete",r={"Content-Type":"application/json; charset=utf-8","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"},o=`?location=${e}&v=2`;try{const a=`${t}${o}`,i=await(await fetch(a,{method:"GET",headers:r})).text(),s=g(i),{exactMatch:n}=s.payload||{},l=Number(n.id.replace(n.type,"").replace("_",""));return l||console.log("no region id found for zip"),l}catch{return console.log("zip code not found"),null}},J=async e=>({data:await f(e)}),v=async e=>{const t=await f(e);return V(t)},V=e=>{const t=M.load(e)('script:contains("ReactServerAgent.cache")').text()?.replace(`_tLAB.wait(function(){
2
2
  (function (root) {
3
3
  /* -- Data -- */
4
4
  root.__reactServerState || (root.__reactServerState = {});
5
- root.__reactServerState.InitialContext = {"ReactServerAgent.cache":`,"")?.split(',"deviceType":"desktop"')[0],r=(t&&JSON.parse(t))?.dataCache,o=r?.["/stingray/api/home/details/initialInfo"]?.res?.text&&g(r["/stingray/api/home/details/initialInfo"].res.text)?.payload,a=o?.propertyId??o?.redirectUrl?.split("/").pop(),i=r?.[`/stingray/api/v1/rentals/homecards?propertyIds=${a}`]?.res?.text,s=i&&g(i),n=r?.["/stingray/api/home/details/belowTheFold"]?.res?.text,p=n&&g(n)?.payload,l=r?.[`/stingray/api/home/details/propertyParcelInfo?propertyId=${a}&pageType=6`]?.res?.text,d=l&&g(l)?.payload,_=s?.homes?.[0]?.rentalExtension?.rentalId,m=r?.[`/stingray/api/v1/rentals/${_}/floorPlans?`]?.res?.text,y=m&&g(m),u={hasPropertyHistory:!!p?.propertyHistoryInfo,propertyId:a,rentalId:_,initialInfo:o,homeCards:s,floorPlans:y,belowTheFold:p,propertyParcelInfo:d};return{timestamp:h(),...u}},R=async(e,t)=>{const{timeoutMs:r}=t??{},o=await K(),a={headers:{"Content-Type":"text/html; charset=utf-8","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36",...o&&{Cookie:o}},...r&&{signal:(s=>{const n=new AbortController;return setTimeout(()=>n.abort(),s||0),n.signal})(r)}},i=await fetch(e,a);if(i.status===202&&T(`Redfin bot filtering (202) for ${e} \u2014 restart the browser server to refresh the cookie.`),i.ok)return await i.text();{const s=await i.text().catch(()=>""),n=(s&&JSON.parse(s)?.error)??`${i.status} ${i.statusText}`;T(n)}},ee=async(e,t)=>await H(t??`https://www.redfin.com/us/home/${e}`),te=async({regionId:e,zipCode:t,timeoutMs:r,daysListed:o})=>{t&&(e=await N(t)??e);try{const a=await V({regionId:e,timeoutMs:r}),i=a?.numMatchedHomes,s=o?a?.homes?.filter(l=>h().diff(l?.rentalExtension?.freshnessTimestamp,"day")<o):a?.homes,n=s?.map(l=>l?.detailUrl),p=s?.length;return p?{timestamp:h(),...t&&{zipCode:t},regionId:e,numResults:p,totalResultCount:i,results:s,urls:n}:null}catch(a){throw console.log(a),a}},V=async({regionId:e,timeoutMs:t})=>{const r="https://www.redfin.com/stingray/api/v1/search/rentals",o={"Content-Type":"application/json; charset=utf-8","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"},a=`?al=1&isRentals=true&market=socal&num_homes=350&ord=days-on-redfin-asc&page_number=1&region_id=${e}&region_type=2&sf=1,2,3,5,6,7&start=0&status=9&uipt=1,2,3,4&use_max_pins=true&v=8`,i={headers:o,...t&&{signal:(n=>{const p=new AbortController;return setTimeout(()=>p.abort(),n||0),p.signal})(t)}},s=`${r}${a}`;return await(await fetch(s,i)).json()},B=async(e,t)=>{const{fromFile:r=!0}=t??{};return r?(await M("zillow","regionIds")??{})[String(e)]??null:await re(e)},re=async e=>{const t="https://www.zillow.com/graphql",r={operationName:"getAutocompleteResults",variables:{query:String(e),queryOptions:{maxResults:10,userIdentity:{abKey:"3176854b-962d-4266-8bb8-f9e8f2377158"},userSearchContext:"FOR_RENT",userLocation:{latitude:34.11,longitude:-118.23}},resultType:["REGIONS","FORSALE","RENTALS","SOLD","COMMUNITIES","BUILDER_COMMUNITIES"]},query:`query getAutocompleteResults($query: String!, $queryOptions: SearchAssistanceQueryOptions, $resultType: [SearchAssistanceResultType]) {
5
+ root.__reactServerState.InitialContext = {"ReactServerAgent.cache":`,"")?.split(',"deviceType":"desktop"')[0],r=(t&&JSON.parse(t))?.dataCache,o=r?.["/stingray/api/home/details/initialInfo"]?.res?.text&&g(r["/stingray/api/home/details/initialInfo"].res.text)?.payload,a=o?.propertyId??o?.redirectUrl?.split("/").pop(),i=r?.[`/stingray/api/v1/rentals/homecards?propertyIds=${a}`]?.res?.text,s=i&&g(i),n=r?.["/stingray/api/home/details/belowTheFold"]?.res?.text,l=n&&g(n)?.payload,p=r?.[`/stingray/api/home/details/propertyParcelInfo?propertyId=${a}&pageType=6`]?.res?.text,d=p&&g(p)?.payload,_=s?.homes?.[0]?.rentalExtension?.rentalId,m=r?.[`/stingray/api/v1/rentals/${_}/floorPlans?`]?.res?.text,y=m&&g(m),u={hasPropertyHistory:!!l?.propertyHistoryInfo,propertyId:a,rentalId:_,initialInfo:o,homeCards:s,floorPlans:y,belowTheFold:l,propertyParcelInfo:d};return{timestamp:h(),...u}},f=async(e,t)=>{const{timeoutMs:r}=t??{},o=await Q(),a={headers:{"Content-Type":"text/html; charset=utf-8","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36",...o&&{Cookie:o}},...r&&{signal:(s=>{const n=new AbortController;return setTimeout(()=>n.abort(),s||0),n.signal})(r)}},i=await fetch(e,a);if(i.status===202&&T(`Redfin bot filtering (202) for ${e} \u2014 restart the browser server to refresh the cookie.`),i.ok)return await i.text();{const s=await i.text().catch(()=>""),n=(s&&JSON.parse(s)?.error)??`${i.status} ${i.statusText}`;T(n)}},ee=async(e,t)=>await v(t??`https://www.redfin.com/us/home/${e}`),te=async({regionId:e,zipCode:t,timeoutMs:r,daysListed:o})=>{t&&(e=await H(t)??e);try{const a=await B({regionId:e,timeoutMs:r}),i=a?.numMatchedHomes,s=o?a?.homes?.filter(p=>h().diff(p?.rentalExtension?.freshnessTimestamp,"day")<o):a?.homes,n=s?.map(p=>p?.detailUrl),l=s?.length;return l?{timestamp:h(),...t&&{zipCode:t},regionId:e,numResults:l,totalResultCount:i,results:s,urls:n}:null}catch(a){throw console.log(a),a}},B=async({regionId:e,timeoutMs:t})=>{const r="https://www.redfin.com/stingray/api/v1/search/rentals",o={"Content-Type":"application/json; charset=utf-8","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36"},a=`?al=1&isRentals=true&market=socal&num_homes=350&ord=days-on-redfin-asc&page_number=1&region_id=${e}&region_type=2&sf=1,2,3,5,6,7&start=0&status=9&uipt=1,2,3,4&use_max_pins=true&v=8`,i={headers:o,...t&&{signal:(n=>{const l=new AbortController;return setTimeout(()=>l.abort(),n||0),l.signal})(t)}},s=`${r}${a}`;return await(await fetch(s,i)).json()},U=async(e,t)=>{const{fromFile:r=!0}=t??{};return r?(await F("zillow","regionIds")??{})[String(e)]??null:await re(e)},re=async e=>{const t="https://www.zillow.com/graphql",r={operationName:"getAutocompleteResults",variables:{query:String(e),queryOptions:{maxResults:10,userIdentity:{abKey:"3176854b-962d-4266-8bb8-f9e8f2377158"},userSearchContext:"FOR_RENT",userLocation:{latitude:34.11,longitude:-118.23}},resultType:["REGIONS","FORSALE","RENTALS","SOLD","COMMUNITIES","BUILDER_COMMUNITIES"]},query:`query getAutocompleteResults($query: String!, $queryOptions: SearchAssistanceQueryOptions, $resultType: [SearchAssistanceResultType]) {
6
6
  searchAssistanceResult: zgsAutocompleteRequest(
7
7
  query: $query
8
8
  queryOptions: $queryOptions
@@ -129,7 +129,7 @@ fragment RentalCommunityResultFields on SearchAssistanceRentalCommunityResult {
129
129
  fragment BuilderCommunityResultFields on SearchAssistanceBuilderCommunityResult {
130
130
  plid
131
131
  __typename
132
- }`},o={accept:"*/*","accept-encoding":"gzip, deflate, br, zstd","accept-language":"en-US,en;q=0.7","client-id":"hops-homepage","content-type":"application/json",origin:"https://www.zillow.com",priority:"u=1, i",referer:"https://www.zillow.com/","sec-ch-ua":'"Brave";v="135", "Not-A.Brand";v="8", "Chromium";v="135"',"sec-ch-ua-mobile":"?0","sec-ch-ua-platform":'"macOS"',"user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36","sec-fetch-site":"same-origin","sec-fetch-dest":"empty","sec-fetch-mode":"cors",cookie:await b()};try{const{data:a}=await c.post(t,r,{headers:o})||{},{regionId:i}=a.data.searchAssistanceResult.results.filter(s=>s?.regionId)?.[0]||{};return i||console.log("no region id found for zip"),i}catch(a){const{status:i,message:s}=F(a)??{};if(E(i,s))T(s,i);else return console.log("zip code not found"),null}},U={Accept:"*/*","Accept-Language":"en-US,en;q=0.5","Content-Type":"application/json",Origin:"https://www.zillow.com",Referer:"https://www.zillow.com/",Priority:"u=1, i","Sec-Ch-Ua":'"Brave";v="147", "Not.A/Brand";v="8", "Chromium";v="147"',"Sec-Ch-Ua-Mobile":"?0","Sec-Ch-Ua-Platform":'"macOS"',"Sec-Fetch-Dest":"empty","Sec-Fetch-Mode":"cors","Sec-Fetch-Site":"same-origin","Sec-Gpc":"1","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36"},G=async({page:e,daysOnZillow:t,regionId:r,zipCode:o,mergePageResults:a,timeoutMs:i})=>{o&&(r=await B(o)??r),e=(a?1:e)??1;const s=await f({page:e,daysOnZillow:t,regionId:r,zipCode:o,timeoutMs:i}),n=s?.cat1?.searchList?.totalResultCount,p=s?.cat1?.searchList?.resultsPerPage,l=s?.cat1?.searchList?.totalPages;if(e&&e>l)return null;const d=a&&Array.from({length:l},(u,C)=>C+1),_=a&&l>1&&d?(await Promise.all(d?.map(async u=>await f({page:u,daysOnZillow:t,regionId:r,zipCode:o},!0)))).flat():s?.cat1?.searchResults?.listResults,m=_?.map(u=>u?.detailUrl),y=_?.length;return y?{timestamp:h(),...o&&{zipCode:o},regionId:r,numResults:y,totalResultCount:n,resultsPerPage:p,...a&&{mergePageResults:a},...d?{pagesCrawled:d?.length}:{page:e},totalPages:l,results:_,urls:m}:null},f=async({page:e,daysOnZillow:t,regionId:r,zipCode:o,timeoutMs:a},i)=>{const s="https://www.zillow.com/async-create-search-page-state",n={searchQueryState:{pagination:{currentPage:e??1},isMapVisible:!1,mapBounds:{east:-116.2057669921875,north:35.424914784130365,south:32.12915408246069,west:-120.3915580078125},regionSelection:[{regionId:r,regionType:7}],filterState:{sortSelection:{value:"days"},doz:{value:String(t??5)},isNewConstruction:{value:!1},isForSaleForeclosure:{value:!1},isForSaleByOwner:{value:!1},isForSaleByAgent:{value:!1},isForRent:{value:!0},isComingSoon:{value:!1},isAuction:{value:!1},isAllHomes:{value:!0}},isListVisible:!0,...o&&{usersSearchTerm:String(o)}},wants:{cat1:["listResults"]},requestId:6,isDebugRequest:!1},p=m=>{const y=new AbortController;return setTimeout(()=>y.abort(),m||0),y.signal},l=await b(),d={headers:{...U,cookie:l},...a&&{signal:p(a)}},{data:_}=await c.put(s,n,d)||{};return i?_?.cat1?.searchResults?.listResults:_},S=async(e,t)=>{const{timeoutMs:r}=t??{},o={headers:{Host:"www.zillow.com",accept:"*/*","content-type":"text/html; charset=utf-8","user-agent":"insomnia/10.3.0"},...r&&{signal:(i=>{const s=new AbortController;return setTimeout(()=>s.abort(),i||0),s.signal})(r)}},{data:a}=await c.options(e,o)||{};if(!a||a===""){const i=new Error("empty response");throw i.response={status:0,data:"empty response"},i}if(typeof a=="string"&&a.includes("px-captcha")){const i=new Error("captcha");throw i.response={status:403,data:"captcha"},i}return a},oe=async e=>({data:await S(e)}),ae=async e=>{const t=await S(e);return x(t)},ie=(e,t)=>{if(t==="building")return e?.initialReduxState?.gdp?.building??null;{e=e&&JSON.parse(e?.gdpClientCache);const r=e&&Object.keys(e)?.[0];return e=e?.[r]?.property,e??null}},x=e=>{const t=L.load(e)("#__NEXT_DATA__").text(),r=t&&JSON.parse(t)?.props?.pageProps?.componentProps,o=r?.initialReduxState?.gdp?"building":"property",a=ie(r,o);return{timestamp:h(),...a}},w={accept:"*/*","accept-encoding":"gzip, deflate, br, zstd","accept-language":"en-US,en;q=0.9","client-id":"for-sale-sub-app-browser-client","content-type":"application/json","Cache-Control":"no-cache",Pragma:"no-cache",priority:"u=1, i","sec-ch-ua":'"Google Chrome";v="136", "Not(A:Brand";v="8", "Chromium";v="136"',"sec-ch-ua-mobile":"?0","sec-ch-ua-platform":'"macOS"',"sec-fetch-dest":"empty","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36","x-z-enable-oauth-conversion":"true"},z=async(e,t)=>{const{altFetch:r,onlyRemovedListings:o=!1}=t??{},a=(r?await ne(e,t):await se(e,t))||{},{property:i,...s}=a;if(i){const{buyAbilityData:n,collections:p,nearbyCities:l,nearbyNeighborhoods:d,nearbyZipcodes:_,schools:m,nearbyHomes:y,listingMetadata:u,homeInsights:C,responsivePhotos:ue,submitFlow:ge,contactFormRenderData:he,tourEligibility:Te,onsiteMessage:Ae,ZoDsFsUpsellTop:be,streetViewMetadataUrlMapLightboxAddress:Se,responsivePhotosOriginalRatio:Pe,thirdPartyVirtualTour:Re,vrModel:fe,topNavJson:we,...A}=i||{};if(!A?.priceHistory)return null;if(o){const{homeStatus:I}=A??{};if(!I)return console.log("no home status",e),null;if(I==="FOR_RENT"){const[D]=A?.priceHistory??{};return D?.event?console.log("recent price history not removed",e,D?.event):console.log("no recent price history"),null}}return{timestamp:h(),...A,...s,...r&&{altFetch:r}}}},se=async(e,t)=>{const{timeoutMs:r}=t??{},o="https://www.zillow.com/graphql",a=`?extensions=%7B%22persistedQuery%22%3A%7B%22version%22%3A1%2C%22sha256Hash%22%3A%222a50ebbffc7b6fb6e70fad24b7738df5db7f2ed5b61c2b980542749accff1f17%22%7D%7D&variables=%7B%22zpid%22%3A${e}%2C%22platform%22%3A%22DESKTOP_WEB%22%2C%22formType%22%3A%22OPAQUE%22%2C%22contactFormRenderParameter%22%3A%7B%22zpid%22%3A${e}%2C%22platform%22%3A%22desktop%22%2C%22isDoubleScroll%22%3Atrue%7D%2C%22skipCFRD%22%3Afalse%2C%22ompPlatform%22%3A%22web%22%7D`,i=`${o}${a}`,s=d=>{const _=new AbortController;return setTimeout(()=>_.abort(),d||0),_.signal},n=await b(),p={headers:{...w,cookie:n},...r&&{signal:s(r)}},{data:l}=await c.get(i,p)||{};return l?.data},ne=async(e,{timeoutMs:t})=>{const r="https://www.zillow.com/graphql",o={operationName:"ForRentShopperPlatformFullRenderQuery",variables:{zpid:e,altId:null},query:`query ForRentShopperPlatformFullRenderQuery($zpid: ID!, $altId: ID, $skipPropertyPrice: Boolean = false, $skipPropertyAddress: Boolean = false) {
132
+ }`},o={accept:"*/*","accept-encoding":"gzip, deflate, br, zstd","accept-language":"en-US,en;q=0.7","client-id":"hops-homepage","content-type":"application/json",origin:"https://www.zillow.com",priority:"u=1, i",referer:"https://www.zillow.com/","sec-ch-ua":'"Brave";v="135", "Not-A.Brand";v="8", "Chromium";v="135"',"sec-ch-ua-mobile":"?0","sec-ch-ua-platform":'"macOS"',"user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36","sec-fetch-site":"same-origin","sec-fetch-dest":"empty","sec-fetch-mode":"cors",cookie:await A()};try{const{data:a}=await c.post(t,r,{headers:o})||{},{regionId:i}=a.data.searchAssistanceResult.results.filter(s=>s?.regionId)?.[0]||{};return i||console.log("no region id found for zip"),i}catch(a){const{status:i,message:s}=O(a)??{};if(C(i,s))T(s,i);else return console.log("zip code not found"),null}},G={Accept:"*/*","Accept-Language":"en-US,en;q=0.5","Content-Type":"application/json",Origin:"https://www.zillow.com",Referer:"https://www.zillow.com/",Priority:"u=1, i","Sec-Ch-Ua":'"Brave";v="147", "Not.A/Brand";v="8", "Chromium";v="147"',"Sec-Ch-Ua-Mobile":"?0","Sec-Ch-Ua-Platform":'"macOS"',"Sec-Fetch-Dest":"empty","Sec-Fetch-Mode":"cors","Sec-Fetch-Site":"same-origin","Sec-Gpc":"1","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36"},x=async({page:e,daysOnZillow:t,regionId:r,zipCode:o,mergePageResults:a,timeoutMs:i})=>{o&&(r=await U(o)??r),e=(a?1:e)??1;const s=await w({page:e,daysOnZillow:t,regionId:r,zipCode:o,timeoutMs:i}),n=s?.cat1?.searchList?.totalResultCount,l=s?.cat1?.searchList?.resultsPerPage,p=s?.cat1?.searchList?.totalPages;if(e&&e>p)return null;const d=a&&Array.from({length:p},(u,I)=>I+1),_=a&&p>1&&d?(await Promise.all(d?.map(async u=>await w({page:u,daysOnZillow:t,regionId:r,zipCode:o},!0)))).flat():s?.cat1?.searchResults?.listResults,m=_?.map(u=>u?.detailUrl),y=_?.length;return y?{timestamp:h(),...o&&{zipCode:o},regionId:r,numResults:y,totalResultCount:n,resultsPerPage:l,...a&&{mergePageResults:a},...d?{pagesCrawled:d?.length}:{page:e},totalPages:p,results:_,urls:m}:null},w=async({page:e,daysOnZillow:t,regionId:r,zipCode:o,timeoutMs:a},i)=>{const s="https://www.zillow.com/async-create-search-page-state",n={searchQueryState:{pagination:{currentPage:e??1},isMapVisible:!1,mapBounds:{east:-116.2057669921875,north:35.424914784130365,south:32.12915408246069,west:-120.3915580078125},regionSelection:[{regionId:r,regionType:7}],filterState:{sortSelection:{value:"days"},doz:{value:String(t??5)},isNewConstruction:{value:!1},isForSaleForeclosure:{value:!1},isForSaleByOwner:{value:!1},isForSaleByAgent:{value:!1},isForRent:{value:!0},isComingSoon:{value:!1},isAuction:{value:!1},isAllHomes:{value:!0}},isListVisible:!0,...o&&{usersSearchTerm:String(o)}},wants:{cat1:["listResults"]},requestId:6,isDebugRequest:!1},l=m=>{const y=new AbortController;return setTimeout(()=>y.abort(),m||0),y.signal},p=await A(),d={headers:{...G,cookie:p},...a&&{signal:l(a)}},{data:_}=await c.put(s,n,d)||{};return i?_?.cat1?.searchResults?.listResults:_},S=async(e,t)=>{const{timeoutMs:r}=t??{},o={headers:{Host:"www.zillow.com",accept:"*/*","content-type":"text/html; charset=utf-8","user-agent":"insomnia/10.3.0"},...r&&{signal:(i=>{const s=new AbortController;return setTimeout(()=>s.abort(),i||0),s.signal})(r)}},{data:a}=await c.options(e,o)||{};if(!a||a===""){const i=new Error("empty response");throw i.response={status:0,data:"empty response"},i}if(typeof a=="string"&&a.includes("px-captcha")){const i=new Error("captcha");throw i.response={status:403,data:"captcha"},i}return a},oe=async e=>({data:await S(e)}),ae=async e=>{const t=await S(e);return z(t)},ie=(e,t)=>{if(t==="building")return e?.initialReduxState?.gdp?.building??null;{const r=e&&JSON.parse(e?.gdpClientCache);return r?Object.values(r).find(o=>o?.property)?.property??null:null}},z=e=>{const t=M.load(e)("#__NEXT_DATA__").text(),r=t&&JSON.parse(t)?.props?.pageProps?.componentProps,o=r?.initialReduxState?.gdp?"building":"property",a=ie(r,o);return{timestamp:h(),...a}},E={accept:"*/*","accept-encoding":"gzip, deflate, br, zstd","accept-language":"en-US,en;q=0.9","client-id":"for-sale-sub-app-browser-client","content-type":"application/json","Cache-Control":"no-cache",Pragma:"no-cache",priority:"u=1, i","sec-ch-ua":'"Google Chrome";v="136", "Not(A:Brand";v="8", "Chromium";v="136"',"sec-ch-ua-mobile":"?0","sec-ch-ua-platform":'"macOS"',"sec-fetch-dest":"empty","sec-fetch-mode":"cors","sec-fetch-site":"same-origin","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36","x-z-enable-oauth-conversion":"true"},k=async(e,t)=>{const{altFetch:r,onlyRemovedListings:o=!1}=t??{},a=(r?await ne(e,t):await se(e,t))||{},{property:i,...s}=a;if(i){const{buyAbilityData:n,collections:l,nearbyCities:p,nearbyNeighborhoods:d,nearbyZipcodes:_,schools:m,nearbyHomes:y,listingMetadata:u,homeInsights:I,responsivePhotos:ue,submitFlow:ge,contactFormRenderData:he,tourEligibility:Te,onsiteMessage:Ae,ZoDsFsUpsellTop:be,streetViewMetadataUrlMapLightboxAddress:Se,responsivePhotosOriginalRatio:Pe,thirdPartyVirtualTour:Re,vrModel:fe,topNavJson:we,...b}=i||{};if(!b?.priceHistory)return null;if(o){const{homeStatus:D}=b??{};if(!D)return console.log("no home status",e),null;if(D==="FOR_RENT"){const[L]=b?.priceHistory??{};return L?.event?console.log("recent price history not removed",e,L?.event):console.log("no recent price history"),null}}return{timestamp:h(),...b,...s,...r&&{altFetch:r}}}},se=async(e,t)=>{const{timeoutMs:r}=t??{},o="https://www.zillow.com/graphql",a=`?extensions=%7B%22persistedQuery%22%3A%7B%22version%22%3A1%2C%22sha256Hash%22%3A%222a50ebbffc7b6fb6e70fad24b7738df5db7f2ed5b61c2b980542749accff1f17%22%7D%7D&variables=%7B%22zpid%22%3A${e}%2C%22platform%22%3A%22DESKTOP_WEB%22%2C%22formType%22%3A%22OPAQUE%22%2C%22contactFormRenderParameter%22%3A%7B%22zpid%22%3A${e}%2C%22platform%22%3A%22desktop%22%2C%22isDoubleScroll%22%3Atrue%7D%2C%22skipCFRD%22%3Afalse%2C%22ompPlatform%22%3A%22web%22%7D`,i=`${o}${a}`,s=d=>{const _=new AbortController;return setTimeout(()=>_.abort(),d||0),_.signal},n=await A(),l={headers:{...E,cookie:n},...r&&{signal:s(r)}},{data:p}=await c.get(i,l)||{};return p?.data},ne=async(e,{timeoutMs:t})=>{const r="https://www.zillow.com/graphql",o={operationName:"ForRentShopperPlatformFullRenderQuery",variables:{zpid:e,altId:null},query:`query ForRentShopperPlatformFullRenderQuery($zpid: ID!, $altId: ID, $skipPropertyPrice: Boolean = false, $skipPropertyAddress: Boolean = false) {
133
133
  property(zpid: $zpid, palsId: $altId) {
134
134
  ...FrActionBarContent_property
135
135
  ...FrMediaColumnContent_property
@@ -2398,7 +2398,7 @@ fragment ForRentSearchPageStateParamsFragment_property on Property {
2398
2398
  fragment RentalPrequalificationCard on ABTests {
2399
2399
  RC_QUALIFICATION_FLOW: abTest(trial: "RC_QUALIFICATION_FLOW")
2400
2400
  }
2401
- `},a=p=>{const l=new AbortController;return setTimeout(()=>l.abort(),p||0),l.signal},i=await b(),s={headers:{...w,cookie:i},...t&&{signal:a(t)}},{data:n}=await c.post(r,o,s)||{};return n?.data},pe=async e=>{const t="https://www.zillow.com/graphql",r={operationName:"ListingContactDetailsQuery",variables:{zpid:e,altId:null},query:`query ListingContactDetailsQuery($zpid: ID!, $altId: ID) {
2401
+ `},a=l=>{const p=new AbortController;return setTimeout(()=>p.abort(),l||0),p.signal},i=await A(),s={headers:{...E,cookie:i},...t&&{signal:a(t)}},{data:n}=await c.post(r,o,s)||{};return n?.data},le=async e=>{const t="https://www.zillow.com/graphql",r={operationName:"ListingContactDetailsQuery",variables:{zpid:e,altId:null},query:`query ListingContactDetailsQuery($zpid: ID!, $altId: ID) {
2402
2402
  viewer {
2403
2403
  roles {
2404
2404
  isLandlordLiaisonMember
@@ -2458,4 +2458,4 @@ fragment RentalPrequalificationCard on ABTests {
2458
2458
  }
2459
2459
  }
2460
2460
  }
2461
- `},{data:o}=await c.post(t,r,{headers:w})||{};return o?.data?.property},E=(e,t)=>e===403&&t?.includes("captcha"),le=e=>q(e),k=async e=>{const{data:t}=await c.post("http://localhost:8082/browser/open",{url:e});return t?.browser},W=async()=>{const{data:e}=await c.post("http://localhost:8082/browser/status");return e?.browser},_e=async()=>{try{return(await W())?.status==="captcha"}catch{return!1}},Z=async()=>{await c.post("http://localhost:8082/cookie/refresh")},X=async(e,t=0)=>{try{await Q()||T("zip codes required, please run the createConfig script");const{fetchListings:r=!1}=e??{},o=3101,{results:a}=await G({regionId:o,daysOnZillow:1,mergePageResults:!1})??{},{zpid:i,detailUrl:s}=a?.[0]??{};return i&&r?await z(i):a?.length&&!r||(s&&!s.startsWith("/apartments")?await S(s):t<5?await X(e,t+1):T("Could not find a valid listing URL to check for bot filtering.")),!0}catch(r){const{status:o,message:a}=F(r);E(o,a)&&T("Zillow bot filtering! Please open https://zillow.com in your browser and complete the challenge to continue.")}},$=async()=>{const{data:e}=await c.post("http://localhost:8082/captcha/solve");return e?.solved===!0},de=async()=>{let e=!1;for(;;){try{const t=await k("https://www.zillow.com/homes/for_rent/");if(t?.status==="captcha"){if(!e&&await O()){e=!0,await $();continue}}else if(t?.status==="navigated")return await Z(),!0}catch{}await new Promise(t=>setTimeout(t,500))}},ce=async()=>{let e=!1,t=null,r=!1;for(;;){try{if(!e)(await k("https://www.zillow.com/homes/for_rent/"))?.status==="captcha"&&(e=!0,t=Date.now());else{if((await W())?.status==="navigated"){if((t?Date.now()-t:0)>=3e3)return await Z(),!0;e=!1,t=null,r=!1}if(!r&&await O()){r=!0,await $();continue}}}catch{}await new Promise(o=>setTimeout(o,e?500:100))}},Y=()=>{const e=["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36","Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36","Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15","Mozilla/5.0 (Macintosh; Intel Mac OS X 13_1) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15"],t=Math.floor(Math.random()*e.length);return e[t]},ye=async(e,t)=>{const r=await j.launch({headless:!0,timeout:1e5,defaultViewport:null}),o=await r.newPage();if(e.includes("file://"))await o.setJavaScriptEnabled(!1);else{const i=Y();await o.setUserAgent(i)}await o.goto(e,{waitUntil:"networkidle2"});const a=await o.evaluate(()=>document.querySelector(".layout-content-container")?.clientHeight);a&&await o.setViewport({width:1024,height:a}),await o.screenshot({path:t,fullPage:!0,captureBeyondViewport:!0}),await o.close(),await r.close(),console.log(`screenshot complete, ${t}`)},me=e=>{if(e==null||typeof e!="object")return!1;const t=e;return!(t.address===void 0||typeof t.bedrooms!="number"||typeof t.bedrooms!="number"||typeof t.daysOnZillow!="number"||typeof t.hdpUrl!="string"||typeof t.homeStatus!="string"||typeof t.homeType!="string"||typeof t.isRentalListingOffMarket!="boolean"||typeof t.price!="number"||typeof t.timeOnZillow!="string"||typeof t.zipcode!="string"||typeof t.zpid!="number")};export{X as checkForZillowBotFiltering,R as fetchHtmlFromRedfinListingUrl,S as fetchHtmlFromZillowListingUrl,V as fetchRedfinListingResults,P as fetchRedfinRegionIdByZipCode,f as fetchZillowListingResults,Y as generateRandomUA,J as getHtmlFromRedfinListingUrl,oe as getHtmlFromZillowListingUrl,le as getRandomZipCode,ee as getRedfinListingDetailsById,te as getRedfinListingResults,N as getRedfinRegionIdByZipCode,pe as getZillowListingContactDetailsByZpid,z as getZillowListingDetailsByZpid,G as getZillowListingResults,B as getZillowRegionIdByZipCode,_e as isBrowserShowingCaptcha,E as isZillowBotFiltering,me as isZillowListingForRow,g as parseRedfinResponse,v as scrapeDataFromRedfinListingHtml,H as scrapeDataFromRedfinListingUrl,x as scrapeDataFromZillowListingHtml,ae as scrapeDataFromZillowListingUrl,ye as screenshotZillowListing,de as waitForSolvedZillowCaptcha,ce as waitForZillowCaptchaSolve,U as zillowListingResultsHeaders};
2461
+ `},{data:o}=await c.post(t,r,{headers:E})||{};return o?.data?.property},C=(e,t)=>e===403&&t?.includes("captcha"),pe=e=>K(e),W=async e=>{const{data:t}=await c.post("http://localhost:8082/browser/open",{url:e});return t?.browser},Z=async()=>{const{data:e}=await c.post("http://localhost:8082/browser/status");return e?.browser},_e=async()=>{try{return(await Z())?.status==="captcha"}catch{return!1}},X=async()=>{await c.post("http://localhost:8082/cookie/refresh")},$=async(e,t=0)=>{try{await N()||T("zip codes required, please run the createConfig script");const{fetchListings:r=!1}=e??{},o=3101,{results:a}=await x({regionId:o,daysOnZillow:1,mergePageResults:!1})??{},{zpid:i,detailUrl:s}=a?.[0]??{};return i&&r?await k(i):a?.length&&!r||(s&&!s.startsWith("/apartments")?await S(s):t<5?await $(e,t+1):T("Could not find a valid listing URL to check for bot filtering.")),!0}catch(r){const{status:o,message:a}=O(r);C(o,a)&&T("Zillow bot filtering! Please open https://zillow.com in your browser and complete the challenge to continue.")}},Y=async()=>{const{data:e}=await c.post("http://localhost:8082/captcha/solve");return e?.solved===!0},de=async()=>{let e=!1;for(;;){try{const t=await W("https://www.zillow.com/homes/for_rent/");if(t?.status==="captcha"){if(!e&&await P()){e=!0,await Y(),e=!1;continue}}else if(t?.status==="navigated")return await X(),!0}catch{}await new Promise(t=>setTimeout(t,500))}},ce=async()=>{let e=!1,t=null,r=!1;for(;;){try{if(!e)(await W("https://www.zillow.com/homes/for_rent/"))?.status==="captcha"&&(e=!0,t=Date.now());else{if((await Z())?.status==="navigated"){if((t?Date.now()-t:0)>=3e3)return await X(),!0;e=!1,t=null,r=!1}if(!r&&await P()){r=!0,await Y();continue}}}catch{}await new Promise(o=>setTimeout(o,e?500:100))}},q=()=>{const e=["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36","Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36","Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15","Mozilla/5.0 (Macintosh; Intel Mac OS X 13_1) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15"],t=Math.floor(Math.random()*e.length);return e[t]},ye=async(e,t)=>{const r=await j.launch({headless:!0,timeout:1e5,defaultViewport:null}),o=await r.newPage();if(e.includes("file://"))await o.setJavaScriptEnabled(!1);else{const i=q();await o.setUserAgent(i)}await o.goto(e,{waitUntil:"networkidle2"});const a=await o.evaluate(()=>document.querySelector(".layout-content-container")?.clientHeight);a&&await o.setViewport({width:1024,height:a}),await o.screenshot({path:t,fullPage:!0,captureBeyondViewport:!0}),await o.close(),await r.close(),console.log(`screenshot complete, ${t}`)},me=e=>{if(e==null||typeof e!="object")return!1;const t=e;return!(t.address===void 0||typeof t.bedrooms!="number"||typeof t.bedrooms!="number"||typeof t.daysOnZillow!="number"||typeof t.hdpUrl!="string"||typeof t.homeStatus!="string"||typeof t.homeType!="string"||typeof t.isRentalListingOffMarket!="boolean"||typeof t.price!="number"||typeof t.timeOnZillow!="string"||typeof t.zipcode!="string"||typeof t.zpid!="number")};export{$ as checkForZillowBotFiltering,f as fetchHtmlFromRedfinListingUrl,S as fetchHtmlFromZillowListingUrl,B as fetchRedfinListingResults,R as fetchRedfinRegionIdByZipCode,w as fetchZillowListingResults,q as generateRandomUA,J as getHtmlFromRedfinListingUrl,oe as getHtmlFromZillowListingUrl,pe as getRandomZipCode,ee as getRedfinListingDetailsById,te as getRedfinListingResults,H as getRedfinRegionIdByZipCode,P as getZillowAutoCaptcha,A as getZillowCookie,le as getZillowListingContactDetailsByZpid,k as getZillowListingDetailsByZpid,x as getZillowListingResults,U as getZillowRegionIdByZipCode,N as getZillowZipCodes,_e as isBrowserShowingCaptcha,C as isZillowBotFiltering,me as isZillowListingForRow,g as parseRedfinResponse,V as scrapeDataFromRedfinListingHtml,v as scrapeDataFromRedfinListingUrl,z as scrapeDataFromZillowListingHtml,ae as scrapeDataFromZillowListingUrl,ye as screenshotZillowListing,de as waitForSolvedZillowCaptcha,ce as waitForZillowCaptchaSolve,G as zillowListingResultsHeaders};
@@ -0,0 +1 @@
1
+ import{getOutputPathFromConfig as i,getZipCodesFromConfig as t,getValueFromConfigFile as a}from"@rent-scraper/utils/config";const o=async()=>await i("redfin"),e=async()=>await t("redfin"),s=async()=>await a("redfin","daysListed"),l=async()=>await a("redfin","redfinCookie"),w=async()=>await a("zillow","zillowCookie"),n=async()=>await a("zillow","daysListed"),c=async()=>await a("zillow","autoCaptcha"),d=async()=>await a("zillow","forceCaptcha"),f=async()=>await a("zillow","limit"),g=async()=>await a("zillow","offset"),y=async()=>await i("zillow"),C=async()=>await t("zillow");export{n as a,c as b,d as c,f as d,g as e,y as f,w as g,C as h,o as i,e as j,s as k,l};
@@ -0,0 +1,12 @@
1
+ declare const getZillowCookie: () => Promise<string | null>;
2
+ declare const getZillowDaysListed: () => Promise<string | null>;
3
+ declare const getZillowAutoCaptcha: () => Promise<boolean | null>;
4
+ declare const getZillowForceCaptcha: () => Promise<boolean | null>;
5
+ declare const getZillowLimit: () => Promise<number | null>;
6
+ declare const getZillowOffset: () => Promise<number | null>;
7
+ declare const getZillowOutputPath: () => Promise<string>;
8
+ declare const getZillowZipCodes: () => Promise<number[]>;
9
+ type Zpid = string;
10
+
11
+ export { getZillowDaysListed as a, getZillowAutoCaptcha as b, getZillowForceCaptcha as c, getZillowLimit as d, getZillowOffset as e, getZillowOutputPath as f, getZillowCookie as g, getZillowZipCodes as h };
12
+ export type { Zpid as Z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rent-scraper/api",
3
- "version": "1.0.31",
3
+ "version": "1.0.33",
4
4
  "type": "module",
5
5
  "main": "./dist/index.mjs",
6
6
  "module": "./dist/index.mjs",
@@ -31,7 +31,7 @@
31
31
  "cheerio": "^1.1.0",
32
32
  "dayjs": "^1.11.13",
33
33
  "puppeteer": "^24.11.2",
34
- "@rent-scraper/utils": "1.0.31"
34
+ "@rent-scraper/utils": "1.0.33"
35
35
  },
36
36
  "devDependencies": {
37
37
  "unbuild": "^3.5.0",
@@ -1 +0,0 @@
1
- import{getOutputPathFromConfig as i,getZipCodesFromConfig as t,getValueFromConfigFile as a}from"@rent-scraper/utils/config";const e=async()=>await i("redfin"),o=async()=>await t("redfin"),s=async()=>await a("redfin","daysListed"),l=async()=>await a("redfin","redfinCookie"),w=async()=>await a("zillow","zillowCookie"),n=async()=>await a("zillow","daysListed"),d=async()=>await a("zillow","autoCaptcha"),f=async()=>await a("zillow","limit"),g=async()=>await a("zillow","offset"),c=async()=>await i("zillow"),y=async()=>await t("zillow");export{n as a,d as b,f as c,g as d,c as e,y as f,w as g,e as h,o as i,s as j,l as k};