iOS的酒店/咖啡厅/餐厅搜索 [英] iOS Hotel/Cafe/Restaurant search

查看:141
本文介绍了iOS的酒店/咖啡厅/餐厅搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要实现我的iPhone应用程序酒店/咖啡厅/餐厅搜索。

由城。有近10个城市,需要出示例如信息,在这个城市里的所有酒店。 (图片,名称,简短描述,ADRESS也许评级或类似的东西)。

你会不会请咨询我一些API的,我可以用于此目的。

我已经找到了 - 谷歌地图与谷歌地方的事情。也许这是最好的解决办法,但我不知道。

和Expedia - http://developer.ean.com/docs/read/hotel_list但在这里我们只拿到酒店搜索
也许你有更好的想法?


解决方案

试用谷歌Places API的

您将得到JSON / XML响应


  1. 搜索浦那附近的酒店:


  

<一个href=\"https://maps.googleapis.com/maps/api/place/textsearch/json?query=hotels+in+Pune&sensor=true&key=\" rel=\"nofollow\">https://maps.googleapis.com/maps/api/place/textsearch/json?query=hotels+in+Pune&sensor=true&key=
  [API密钥]



<醇开始=2>
  • 在城市搜索特定的地方:


  •   

    https://maps.googleapis.com/maps/api /地点/ TEXTSEARCH / JSON?查询= [搜索
      地名] +在+城市名称]放大器;传感器=真放大器;关键= [API密钥]



    <醇开始=3>
  • 搜索特定的地方城市通过给定类型:


  •   

    https://maps.googleapis.com/maps/api /地点/ TEXTSEARCH / JSON?查询= [搜索
      地名] +在+城市名称]放大器;类型= [广场类型]&放大器;传感器=真放大器;关键= [API密钥]



    • 酒店可以使用类型的食物的和的餐厅的如键入=食品|餐厅


    参考: https://developers.google.com/places/documentation/

    I need to implement Hotel/Cafe/Restaurant search in my ios application.

    Search by the city. Got nearly 10 cities, need to show information for example for all hotels in this city. (Picture, Name, Short Description, Adress and maybe rating or something like that).

    Would you pls advice me some API's that I could use for this purpose.

    What I've found - Google Maps with Google Places thing. Maybe this is the best solution, but I'm not sure.

    And Expedia - http://developer.ean.com/docs/read/hotel_list but here we got only hotel search Maybe you got better ideas?

    解决方案

    Try Google Places API

    You will get JSON/XML response

    1. Search hotels near Pune:

    https://maps.googleapis.com/maps/api/place/textsearch/json?query=hotels+in+Pune&sensor=true&key= [API Key]


    1. Search specific place in city:

    https://maps.googleapis.com/maps/api/place/textsearch/json?query= [Search place Name]+in+[City Name]&sensor=true&key= [API Key]


    1. Search specific place in city by given type:

    https://maps.googleapis.com/maps/api/place/textsearch/json?query= [Search place Name]+in+[City Name]&type=[Place Type]&sensor=true&key= [API Key]

    • For hotels you can use type food and restaurant like type=food|restaurant

    Reference: https://developers.google.com/places/documentation/

    这篇关于iOS的酒店/咖啡厅/餐厅搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆