How can i generate an API key for Baidu China for an website store locator?

Roxi picture Roxi · Nov 18, 2014 · Viewed 11.8k times · Source

I have been asked by our developers to give them an API key for Baidu maps so they can set up our on site store locator and I'm not really sure how to go about doing this.

I tried to set up an account on Baidu but it asked for a chinese mobile number. Do I have to get one of these before I can get the key? And how easy is it to work out how to obtain the key once i've got an account?

Can anyone advise on the best way to set this up?

Thanks in advance!

Answer

peedee picture peedee · Nov 20, 2014

Update 2016: It now appears to be possible to use non-Chinese phone numbers to create Baidu accounts, see this page.

Once you're logged into Baidu you need to find their LBS (location-based services) cloud and go to the control center there:

http://lbsyun.baidu.com/apiconsole/key

There you click "Create a new app/key" 创建应用(0/20) (orange button). In the popup you give it a name and then in your case probably select "for server". The following list of checkboxes is for the things you want to BLOCK for your key. If you want access to everything then tick NOTHING (took me a while to figure that out, I always ticked everything...)

For server keys you can select an IP based whitelist for users, you would enter the addresses of your servers there. I'm not sure about the other (sn) option.

When you click Confirm the new key should appear in the table, copy & use it.