I try to get details for a route with transit mode. When I try to read the results from legs ( result['routes'][0]['legs'][0]['steps']['transit_details']['departure_time']['value'] ), I get a departure time for the transit in a different date and time.
for example,
with this url request:
url: 'https://maps.googleapis.com/maps/api/directions/json?origin=32.324455,34.977291&destination=32.07806,34.802639&mode=transit&transit_mode=train&departure_time=1579008600&key= MyAPI'
I get that the departure time at the first train changed to 15/1/2020 3:47 , however the request departure time was 14/1/2020 13:30.
Related
I am using Google API Client for fitness to retrieve user fitness data using the PHP Client library.
My usecase: To get users Total run time for the day, and also distance.
I am using the following code (sample code with key steps):
$service = new Google_Service_Fitness($google_client);
$dataSets = $service->users_dataset;
..
$aggBy->setDataTypeName("com.google.activity.segment");
..
$aggregates = $dataSets->aggregate('me',$aggReq);
I am using com.google.activity.segment as datatypename:
I get a response with run type with data
Activity type: 8
runtime : value in msec
no of segment: 2
Now i want to get the total distance travelled during running session,
From above response i can make out that user had 2 separate running activity, then how i can get the combined distance done by the particular activity?
Also how i can retrieve details about these in 2 running segment in details?
As said i am using PHP Client API.
The transactions endpoint is not considering the start date we provided in the request query and gives us the transactions which are more than six months older.
Example:
URL: GET a/consumer/api/v0/users/XXXXXXXXXXX/accounts/XXXXXXXXXXX/transactions
HEADER: {"Content-Type"=>"application/json", "Authorization"=>"Bearer **MASKED**"}
QUERY: {"since"=>"2022-06-12", "until"=>"2022-06-29"}
BODY:
When the above request is sent we are getting transactions even from 2021-11-01.
The since, until, and updatedSince query parameters use the ISO-8601 instant for filtering. This means you'll have to use a format similar to: 2022-06-08T00:00:00Z to get the filtering behavior.
We are trying to retrieve the step count of our users in real time. If a user is currently running then we try to fetch the latest value of steps taken. While we are able to retrieve the value of steps one day before today we are not able to do so for the current date.
API URL: https://www.googleapis.com/fitness/v1/users/me/dataset:aggregate
Request Json:
{"aggregateBy":[
{"dataTypeName":"com.google.step_count.delta",
"dataSourceId":"derived:com.google.step_count.delta:com.google.android.gms:estimated_steps"}],
"bucketByTime":{"durationMillis":86400000},
"startTimeMillis":1557685800000,
"endTimeMillis":1557772199999
}
Response received:
{"bucket":[
{"startTimeMillis":"1557685800000",
"endTimeMillis":"1557772199999",
"dataset":[
{"dataSourceId":"derived:com.google.step_count.delta:com.google.android.gms:aggregated",
"point":[]}
]}
]}
I want to make an app displaying LAST x days' temperature on 3 hourly basis using the openweathermap API only. I went through the available APIs. They either have the predicted forecast of next 5 days or the historical data expecting start and end as parameters which I tried to use then (https://openweathermap.org/history).
So just to check whether I have understood the params correctly or not, I tried fetching(through the address bar):
http://history.openweathermap.org/data/2.5/history/city?id=1275339&type=hour&appid=df78dcfa9580e72b15fdf62d406d34ec&start=1369728000&end=1369789200".
But I got HTTP error 401:
{"cod":401, "message": "Invalid API key. Please see http://openweathermap.org/faq#error401 for more info."}
I fail to understand how should the parameters be entered to get the desired results (last 5 days temperature on 3 hourly basis) and also how do I enter "cnt" (if needed to) such that it gives me 3 hourly data.
I want to get the Historic data of Currency exchange, I have tried running this Query on Yahoo console but it wont work.
select * from yahoo.finance.historicaldata where symbol in ("EURUSD=X") and startDate = "2015-06-01" and endDate ="2015-06-02"
Is it something that I'm doing wrong? Or is it not possible in Yahoo API?
Any other suggestion that you can give please?
Please note that I want historic data, not the current exchange rate.