Yahoo Placefinder API和cURL / wget

时间:2011-12-20 23:59:57

标签: json http curl wget yahoo-api

我正在尝试使用我编写的脚本向Yahoo Placefinder API发出请求,我希望它能返回JSON。但是,所有请求都会发回XML。话虽这么说,当我在浏览器中运行相同的脚本时,我会按预期获得JSON数据。以下是我的要求:

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

非常感谢任何帮助。这非常令人沮丧,似乎应该很容易修复!

1 个答案:

答案 0 :(得分:2)

您也可以尝试通过YQL(Yahoo Query Language)使用Placefinder。它提供XML和JSON输出,并为您与其他服务的mashup提供更多灵活性。

以下是一个示例电话:

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

相关问题