# Bing Maps API key

**URL:** <https://community.cesium.com/t/bing-maps-api-key/14587>\
**Category:** Cesium ion\
**Created:** [July 27, 2021, 6:42am UTC](https://community.cesium.com/t/bing-maps-api-key/14587 "2021-07-27T06:42:55Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![rakhishah](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/rakhishah/32/1987_2.png) [@rakhishah](https://community.cesium.com/u/rakhishah)\
**Post date:** [July 27, 2021, 6:42am UTC](https://community.cesium.com/t/bing-maps-api-key/14587/1 "2021-07-27T06:42:55Z")

</div>

Hello Cesium Team,

I want to use BingMapsGeocoderService for cesium search and for that I need to use the Bing Maps API key. I already have a cesium ion access token with the scope set as geocode. Where can I get this key?

---

<div class="post-metadata">

**Author:** ![muthu](https://avatars.discourse-cdn.com/v4/letter/m/bbce88/32.png) [@muthu](https://community.cesium.com/u/muthu)\
**Post date:** [July 27, 2021, 1:12pm UTC](https://community.cesium.com/t/bing-maps-api-key/14587/2 "2021-07-27T13:12:51Z")

</div>

Hi @rakhishah,

Thanks for reaching out!

You can actually hook into the Bing geocoding API from your CesiumJS app. You just need to get a Bing key from here: [https://www.bingmapsportal.com](https://www.bingmapsportal.com/)

Then you can pass it in the viewer constructor to use it:

> var viewer = new Cesium.Viewer(‘cesiumContainer’, {
> 
> geocoder: [ new Cesium.BingMapsGeocoderService({
> 
> key: ‘Your Bing Key’
> 
> }) ]
> 
> });

Best,  
Muthu

---

<div class="post-metadata">

**Author:** ![rakhishah](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/rakhishah/32/1987_2.png) [@rakhishah](https://community.cesium.com/u/rakhishah)\
**Post date:** [July 28, 2021, 11:25am UTC](https://community.cesium.com/t/bing-maps-api-key/14587/3 "2021-07-28T11:25:59Z")

</div>

Hello @muthu,

Thanks for the reply. My question is, I already have the subscription of Cesium ION which provides a bing map geocoder service in terms of the access token. Can I get the key from that token or do I need to do a subscription from [https://www.bingmapsportal.com](https://www.bingmapsportal.com) also?

---

<div class="post-metadata">

**Author:** ![muthu](https://avatars.discourse-cdn.com/v4/letter/m/bbce88/32.png) [@muthu](https://community.cesium.com/u/muthu)\
**Post date:** [July 28, 2021, 2:29pm UTC](https://community.cesium.com/t/bing-maps-api-key/14587/4 "2021-07-28T14:29:28Z")

</div>

Hi @rakhishah,

I’d love to help, but I need more information. Can you put together a [Sandcastle](https://sandcastle.cesium.com/) that demonstrates what you are trying to achieve?

By default, Bing Maps geocoder is enabled with the Cesium ion subscription (screenshot attached). You will not need a separate key for the geocoding service unless you wish to use your own. I hope that helps.

 ![image](https://global.discourse-cdn.com/cesium/original/2X/f/f8705abcf35d5d7db773af181724e26283df4002.jpeg)

Best,  
Muthu

---

<div class="post-metadata">

**Author:** ![rakhishah](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/rakhishah/32/1987_2.png) [@rakhishah](https://community.cesium.com/u/rakhishah)\
**Post date:** [July 29, 2021, 9:18am UTC](https://community.cesium.com/t/bing-maps-api-key/14587/5 "2021-07-29T09:18:57Z")

</div>

Hi @muthu ,

As per the attached thread [https://community.cesium.com/t/cesium-search-not-working-accurately/8274](https://community.cesium.com/t/cesium-search-not-working-accurately/8274) Cesium uses the Pelias geocoder by default and I want to use Bing maps geocoding service, that’s why I need key.

Just go to [Cesium Sandcastle](https://sandcastle.cesium.com/#c=bY09C8IwEIb/ypFJQRKcTYvQVXAQnLKk6anBa1Ly0VJ/vW1dRHvb+97z3PU6QG9xwAAFOBygwmhzy69Lt1HMLLnyLmnrMCi2PSjHdkzGNBKWysEyR9t2PiTIgTaci4RtRzphFHU2T0zcxDiLMyrFtyob24NtipVPYEjHOG1umehiX6hYKcXE/6nkdWPd/dxjID3O2GNfnj4l51yKKa6byXuqdfi5/AY) and go to the network tab it will call one cesium API to load the Bing imagery. In response of that API you will get one key. I used this key as a Bing API key for BingMapsGeocoderService and it was working properly. So, my question is, Is this a valid Bing API key? I’ve attached screenshot of API which shows the API response.

 ![image](https://global.discourse-cdn.com/cesium/original/2X/6/6b96179ed0112cca09f9ab00f34616426be308b5.jpeg)

 ![image](https://global.discourse-cdn.com/cesium/original/2X/f/fc76a6cbb1c752dd793955c12522733a922fc747.jpeg)

---

<div class="post-metadata">

**Author:** ![muthu](https://avatars.discourse-cdn.com/v4/letter/m/bbce88/32.png) [@muthu](https://community.cesium.com/u/muthu)\
**Post date:** [July 29, 2021, 6:30pm UTC](https://community.cesium.com/t/bing-maps-api-key/14587/8 "2021-07-29T18:30:39Z")

</div>

Hi @rakhishah,

Apologies on the error and for not being clear earlier.

Yes. By default, Pelias geocoder is enabled with Bing Maps imagery on Cesium ion. We do not license geocoding service from Bing Maps at the moment, so you will need to get a separate key from the Bing Maps portal.

Let us know if you have any questions.

Best,  
Muthu

---

<div class="post-metadata">

**Author:** ![rakhishah](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/rakhishah/32/1987_2.png) [@rakhishah](https://community.cesium.com/u/rakhishah)\
**Post date:** [August 2, 2021, 4:05am UTC](https://community.cesium.com/t/bing-maps-api-key/14587/9 "2021-08-02T04:05:12Z")

</div>

Muthu,

Do we have any thoughts on helping Pelias along? Bing Maps key is pretty pricey for just finding cities and zooming in. Have we looked at just improving that code? Can we commit to that open source project?

If so, I would like to put one of my developers on it. We are working in quite a few countries in Africa. We can update the polylines with recent data. We might be able to find some open source georeference data as well.

Let me know thoughts. I don’t want to walk down a path that’s already been tried and failed. I’d like to make sure we can help that along for the entire Cesium community.

-Rakhi

---

<div class="post-metadata">

**Author:** ![muthu](https://avatars.discourse-cdn.com/v4/letter/m/bbce88/32.png) [@muthu](https://community.cesium.com/u/muthu)\
**Post date:** [August 3, 2021, 2:33pm UTC](https://community.cesium.com/t/bing-maps-api-key/14587/12 "2021-08-03T14:33:01Z")

</div>

Hi @rakhishah,

Thanks for offering to contribute to the Pelias open source project. Appreciate the support.

Cesium’s Geocoder is a separate, fully-hosted instance of the Pelias Geocoder. It has been a few years since our last update to the geocoder, but it is on our roadmap to update with the latest database in the near future.

Contributing to Pelias will help the geocoder for sure, and will be included in changes when we upgrade the infrastructure on our end, but may not be immediately noticeable right away.

Alternatively, if you choose to subscribe to Pelias’s geocode.earth service, you can replace the URL in the `PeliasGeocoderService` API to point to that. See [PeliasGeocoderService - Cesium Documentation](https://cesium.com/learn/cesiumjs/ref-doc/PeliasGeocoderService.html).

Best,  
Muthu
