0

YQL geo.places randomly returns http 400 bad request

I am using a YQL query to get weather forecast data by location:
select * from weather.forecast 
where u="c" and woeid in (
	select woeid from geo.places where text="Toronto, ON, Canada" limit 1
) limit 1;
This works fine most of the time, but roughly 1 in 5 requests comes back with results: null.
If I enable diagnostics, I can see that it is failing on the geo.places lookup:
"diagnostics": {
 "publiclyCallable": "true",
 "url": {
 "execution-start-time": "1",
 "execution-stop-time": "111",
 "execution-time": "110",
 "http-status-code": "400",
 "http-status-message": "Bad Request",
 "content": "http://where.yahooapis.com/v1/places.q(Toronto%2C%20ON%2C%20Canada);start=0;count=10"
 },
 "user-time": "112",
 "service-time": "110",
 "build-version": "29730"
 }
This happens regardless of the location string I search for. A query can succeed once and then fail the next with identical parameters.

What gives?


To improve things I can store the WOEID locally and split up the query, since I only need to get it once. But it's still an annoying problem for the first time as it happens fairly frequently.

by
1 Reply
    • Aug 30, 2012
    So I found the table geo.placefinder does basically the same thing, and does it reliably, so I'll just use that.
    0

Recent Posts

in YQL