How to load API’s in WordPress?

For google maps in a template file, I just do this:

wp_register_script( 'google-maps-api', 'http://maps.google.com/maps/api/js' );
wp_print_scripts( 'google-maps-api' );

error code: 523