php - Getting Zillow API Data -


i can't access zillow information though feel using api correctly. help?

$zillow_id = '<my zpid>';  $search = "2114 bigelow ave"; $citystate = "seattle, wa"; $address = urlencode($search); $citystatezip = urlencode($citystate); $url = "http://www.zillow.com/webservice/getsearchresults.htm?zws-id=$zillow_id&address=$address&citystatezip=$citystatezip";  $result = file_get_contents($url); //$data = simplexml_load_string($result); print_r($result); 

edit 1: error when run on inmotion hosting

when run code on inmotion hosting server receive :

<html><head><title>zillow: real estate, apartments, mortgage &amp; home values in us</title><meta http-equiv="x-ua-compatible" content="ie=8, ie=9"/><meta name="robots" content="noindex, nofollow"/><link href="//fonts.googleapis.com/css?family=open+sans:400&subset=latin" rel="stylesheet" type="text/css"/><link href="http://www.zillowstatic.com/vstatic/069be37/static/css/z-pages/captcha.css" type="text/css" rel="stylesheet" media="screen"/><script language="javascript"> function onrecaptchaload() { window.recaptchaloaded = true; }  window.settimeout(function () { if (!window.recaptchaloaded) { document.getelementbyid('norecaptcha').value = true; document.getelementbyid('captcha-form').submit(); } }, 5000); </script></head><body><main class="zsg-layout-content"><div class="error-content-block"><div class="error-text-content"><!-- <h1>captcha</h1> --><h5>enter characters in images continue.</h5><div id="content" class="captcha-container"><form method="post" action="" id="captcha-form"><script type="text/javascript"> var recaptchaoptions = {"theme":"white","lang":"en-us"}; </script> <script type="text/javascript" src="http://api.recaptcha.net/challenge?k=6lf2nvmsaaaaamq5p6wlafdeixmdoqgjsij-3_ud" onload="onrecaptchaload()"></script> <br/><input id="dest" name="dest" type="hidden" value="ognl:originaldestination"/><input id="norecaptcha" name="norecaptcha" type="hidden" value="false"/><button type="submit" class="zsg-button zsg-button_primary">submit</button></form><img src="http://www.zillowstatic.com/static/logos/logo-65x14.png" width="65" alt="zillow" height="14"></img></div></div></div></main></body></html><!-- h:025 t:1ms s:1494 r:sat mar 28 09:57:53 pdt 2015 b:4.0.13785-master.359ed12-hotfix-824c097-20150326.222442.359ed1207efb984585ffa75531a9fba99c178f3e.20150326163022395-origin/master --> 

edit 2: additional information

i can curl url in terminal , works. can run php in local host (xampp) , works.

i ran too. hitting when doing serial hits zillows api. example, search address , comps right away property.

if add delay before next hit api seems not throw captcha.

the delay seemed around 300 ms work.

in php

sleep(.3); 

obviously might work use case, 1 work around, ugly is.


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -