0

I am trying to make request from zillow api. However, I want to use proxy.

import zillow
api = zillow.ValuationApi()

data = api.GetSearchResults(key, address, postal_code)

Is there any method to have my requests use my predefined proxy?

Thanks

Jetman
  • 765
  • 4
  • 14
  • 30
RAP_1360
  • 1
  • 1

1 Answers1

0

Hi you can set the proxy using environment variables as below:

HTTP_PROXY="http://<proxy server>:<port>"
HTTPS_PROXY="http://<proxy server>:<port>"

You can read more about proxy in python requests proxy settings page

Amit Nanaware
  • 3,203
  • 1
  • 6
  • 19
  • I have used proxy using requests: r = requests.Session().get(url, params=maddress, proxies= proxy_handler.proxies) Could you elaborate where to add these lines wrt to my codes? I don't see how to pass the HTTP_PROXY and HTTPS_PROXY to zillow api? – RAP_1360 Feb 13 '19 at 05:16
  • `api.GetSearchResults` is using different request so if you want add proxy settings for `api.GetSearchResults` then you can set the environment variables as above. The proxies which you have set are limited for `r` object. – Amit Nanaware Feb 13 '19 at 05:19