2012-05-05 5 views
3

Google 장소의 영업 시간을 확보 할 수있는 방법이 있습니까? 여러 포럼과 문서에서 찾았지만 아무것도 찾지 못했습니다 (아마도 정사각형 API 만 해당 정보를 노출합니다).Google Place API - 영업 시간을 가져 오는 방법

Google은이 정보를 노출하지 않습니까?

이 서비스를 제공하는 서비스가 있습니까? (페이스 북의 장소, 큰소리로 말하다, ECC ..) 모든 너무 많은

덕분에

알베르토가

+0

Google Places API는 현재이 기능을 지원하지 않습니다. Places API 문제 추적기에 다음과 같은 기능 요청이 있습니다. http://code.google.com/p/gmaps-api-issues/issues/detail?id=2431 수 별표 아이콘을 클릭하십시오. 향후 변경 사항에 대한 알림을 받고 귀하가 해결 방법을 알기를 바랍니다. –

답변

8

나는이 지금 가능하다 생각 : 당신이 당신의 자신의 장소 API 키를 만들거나 노드를 설치하지 않는 경우

https://developers.google.com/places/documentation/details#PlaceDetailsResults

샘플 출력 this gist를 참조하십시오.

var request = require('request'); 
// $ npm install request 
// Test code to demonstrate parsing operating hours from Google Places 
// https://developers.google.com/places/documentation/details#PlaceDetailsResults 

// most establishments specify one set of hours per day: 
var testRef = 'CnRoAAAAhWUhxi1GkTSCMDMb2piX2JgQzcMv1v6Bv1rDWAINnWrI6T_Vkn3KRpnI5rTd2NI2f0zy4R8n6vRDoj-qTewKa3r70riORCUF-HNU1FLtI3MHNSw8z0_6fBni6hTuXCsGw1SD44I85ha9GVZOZlAS_hIQuNBJmgTHh9bCC4XvdLiDCBoUfmY1ozj0FW-TvurbmryBdwAvoPo'; 

// 24 hour restaurants only have one period with open:0000 and no close 
var _24hrRef = 'CnRpAAAAcKNSNO0jxSONMAPx7EjG6BdgqhWbzDh1rOWM8I1HJZikRYPxW4L1A1ZwH4HEEBy5diKyXT1nRs2a7cxZK7S4oOr5HrTKewV_WGYdy-CuumuwLzSeckgXWvRdIRCW49JXUeJsqhkhtATHyyIDUYWW4RIQ38ZaUuG8A3WbRrsHLwmwDRoUfmtzSsfki7v8iBmUAZgrUIoVOt0' 

// Restaurants that are closed on some days will have fewer than 7 open:close pairs 

getPlaceDetails(_24hrRef, function(err, result){ 
    if(err){ 
    return console.log('Request error: '+err+result); 
    }; 
    console.log('Request successful:') 
    console.log(JSON.stringify(result.opening_hours, null, 2)); 
}); 

function getPlaceDetails(ref,callback){ 
    var config = { 
    uri:'https://maps.googleapis.com/maps/api/place/details/json', 
    qs: { 
     key: "SOME-VALID-GOOGLEPLACES-API-KEY", 
     // Generate a new Simple API key and plug it in 
     // https://code.google.com/apis/console 
     reference:ref, 
     sensor:'false', 
    } 
    }; 
    request(config, function(err, response, body){ 
    if(err){ return callback(err) }; 
    var res = JSON.parse(body); 
    switch(res.status){ 
     case "OK":   return callback(null, res.result); 
     case "ZERO_RESULTS": return callback(null, res.result); 
     default:    return callback(res.status, body); 
    }; 
    }); 
}; 
2

그들은 페이스 북 API를 통해 노출 회신 할 수 있습니다. 당신에게 나는 옐프 API는이 정보를 노출 확신 155199767827259

:하지만, 그래프 API 탐색기 https://developers.facebook.com/tools/explorer

방문 및 상자에 자신의 ID를 입력 : 예를 들어, 뉴욕에서 FAO 슈워츠는 자신의 시간을 채워있다 어떤 Yelp 정보라도 꽤 명확하게 지정해야합니다.

3

사실적인 API는 작동 시간도 노출시킵니다. 이것은 미국의 800,000 개의 레스토랑으로 구성된 Restaurant API에 있습니다. 이 필드는 JSON 해시로 구성되어 있으며 각 요일은 정수 cf로 인덱싱됩니다. ISO-8601 : 1 = 월요일부터 7 = 일요일.

문서 도구 - 레스토랑 데이터의 http://developer.factual.com/display/docs/Places+API+-+Restaurants

데모 - 레스토랑 엔티티의 http://www.factual.com/data/t/restaurants-us

예.

24: 24, 
open_24hrs: false, 
accessible_wheelchair: true, 
address: "3274 21st St", 
alcohol: false, 
alcohol_bar: false, 
alcohol_beer_wine: false, 
alcohol_byob: false, 
attire: "casual", 
category: "Food & Beverage > Restaurants > Pizza", 
country: "US", 
cuisine: "Pizza, Italian, American, Fast Food, Pasta", 
factual_id: "5873129b-11e9-49db-a012-967b4046420d", 
fax: "(415) 695-1687", 
founded: "1999", 
groups_goodfor: false, 
hours: "{"1":[["11:00","24:00"]],"2":[["11:00","24:00"]],"3":[["11:00","24:00"]],"4":[["11:00","24:00"]],"5":[["11:00","1:00"]],"6":[["11:00","1:00"]],"7":[["11:00","24:00"]]}", 
kids_goodfor: true, 
latitude: 37.75694, 
locality: "San Francisco", 
longitude: -122.42052, 
meal_cater: true, 
meal_deliver: true, 
meal_dinner: true, 
meal_lunch: true, 
meal_takeout: true, 
name: "Serrano's Pizza and Pasta", 
options_vegan: true, 
options_vegetarian: true, 
owner: "Serranos Pizza", 
parking: true, 
payment_cashonly: false, 
postcode: "94110", 
price: 2, 
rating: 4.5, 
region: "CA", 
reservations: false, 
seating_outdoor: true, 
smoking: false, 
status: "1", 
tel: "(415) 695-1615", 
website: "http://www.serranospizza.com/" 
관련 문제