Mason
Mason

Reputation: 7103

Yahoo Placefinder API and cURL/wget

I'm trying to make requests to the Yahoo Placefinder API using a script I wrote, and I'd like it to return JSON. However, all the requests send back XML. That being said, when I run the same script in my browser, I get JSON data as expected. Here are my requests:

wget http://where.yahooapis.com/geocode?location=San+Francisco,+CA&flags=J&appid=yourappid

curl http://where.yahooapis.com/geocode?location=San+Francisco,+CA&flags=J&appid=yourappid

Any help is much appreciated. This is pretty frustrating, and seems like it should be easy to fix!

Upvotes: 1

Views: 590

Answers (1)

BrianC
BrianC

Reputation: 10721

You might also try using Placefinder through YQL (Yahoo Query Language). It offers both XML and JSON output and gives you some more flexibility for mashups with other services.

Here's a sample call:

select * from geo.placefinder where text="sfo"

Upvotes: 2

Related Questions