Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowData Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more
Hi All,
I'm trying to create a tool that connects to Baidu Maps API to extract travel time data based on the different modes of transport.
I've successfully manage to create a custom function that allows dynamic changes to Start and End destinations. However, results i get from Baidu maps is that the "App is not present, there is error in the AK" refer to Column D . When i tested the URL link in a blank webpage, it manage to return valid results for the Start and End locations if i typed in manually. However, if i copy the data from the cell into the URL, it gives error (shown below). Appreciate if anyone can enlighten on what went wrong. Thanks.
(Start as text, End as text) =>
let
Baidu_API_key = "API_key",
Distance_lite = Web.Contents("http://api.map.baidu.com/directionlite/v1/driving?origin=Start&destination=End&ak=Baidu_API_key"),
Results = Json.Document(Distance_lite)
in
Results
Solved! Go to Solution.
Hi All,
my colleague helped to solve the above issue. It is crucial for the orign and destination inputs to omit spacing for the api to be connected correctly. Hence, instead of 22.543648, 113.947003 it should be 22.543648,113.947003.
I've made modifications to my query function and its now pulling the same data as what is available on webpage.
(Start as text, End as text) =>
let
Baidu_API_key = "APIkey",
Distance_lite = Web.Contents("http://api.map.baidu.com/directionlite/v1/transit?",
[Query=
[origin=Start,
destination=End,
ak=Baidu_API_key]]),
Results = Json.Document(Distance_lite)
in
ResultsI read the documentation for Baidu Directions Lite API again, it states that the format of origin needs to be Double, Double. (please see documentation here http://lbsyun.baidu.com/index.php?title=webapi/direction-api-v2)
Greatly appreciate if anyone can suggest a solution to pass the query inputs as number instead of string. I haven't figure out a way to pass the parameter as numbers when comma is involved. The example coordinates i've used were origin = 22.599244, 114.049508 | destination = 22.543648, 113.947003
Thank you.
Hi All,
my colleague helped to solve the above issue. It is crucial for the orign and destination inputs to omit spacing for the api to be connected correctly. Hence, instead of 22.543648, 113.947003 it should be 22.543648,113.947003.
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.