Title: api key?
Last modified: August 22, 2016

---

# api key?

 *  Resolved [jbensonism](https://wordpress.org/support/users/jbensonism/)
 * (@jbensonism)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/api-key-85/)
 * Is there any need to include an API key in the js request?
 * [https://wordpress.org/plugins/stellar-places/](https://wordpress.org/plugins/stellar-places/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Micah Wood](https://wordpress.org/support/users/woodent/)
 * (@woodent)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/api-key-85/#post-5248570)
 * There can be. If your usage exceeds the API usage limits and you need to purchase
   additional quota: [https://developers.google.com/maps/documentation/javascript/tutorial#api_key](https://developers.google.com/maps/documentation/javascript/tutorial#api_key)
 *  Thread Starter [jbensonism](https://wordpress.org/support/users/jbensonism/)
 * (@jbensonism)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/api-key-85/#post-5248578)
 * Thank you,
 * Would I need to modify the init.php to include the key, or just call it first
   in my own page template? It looks like filtering enqueue scripts isn’t an option.(
   Maybe an admin page where I could set a key)
 *  [Micah Wood](https://wordpress.org/support/users/woodent/)
 * (@woodent)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/api-key-85/#post-5248580)
 * I’ll probably end up implementing an admin page where you can add an API key.
   However, you can easily implement it without touching the plugin code:
 *     ```
       define( 'STELLAR_PLACES_GOOGLE_MAPS_API_KEY', 'apiKeyGoesHere' );
   
       if( defined( 'STELLAR_PLACES_GOOGLE_MAPS_API_KEY' ) ) {
           add_filter( 'script_loader_src', 'stellar_places_add_google_maps_api_key' );
   
           function stellar_places_add_google_maps_api_key( $src, $handle ) {
       	if ( 'google-maps-js-api' == $handle || 'google-maps-js-api-places-library' == $handle ) {
       		$src = add_query_arg( 'key', STELLAR_PLACES_GOOGLE_MAPS_API_KEY, $src );
       	}
       	return $src;
           }
       }
       ```
   
 * I’d probably add the constant definition to your wp-config.php file and then 
   drop the rest of the code in a custom site-specific plugin.
 *  Thread Starter [jbensonism](https://wordpress.org/support/users/jbensonism/)
 * (@jbensonism)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/api-key-85/#post-5248581)
 * oh brilliant. thank you!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘api key?’ is closed to new replies.

 * ![](https://ps.w.org/stellar-places/assets/icon-256x256.png?rev=1430567)
 * [Stellar Places](https://wordpress.org/plugins/stellar-places/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/stellar-places/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/stellar-places/)
 * [Active Topics](https://wordpress.org/support/plugin/stellar-places/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/stellar-places/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/stellar-places/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [jbensonism](https://wordpress.org/support/users/jbensonism/)
 * Last activity: [11 years, 9 months ago](https://wordpress.org/support/topic/api-key-85/#post-5248581)
 * Status: resolved