Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8347103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:15:16+00:00 2026-06-09T07:15:16+00:00

I want to allow users to add places to Google Maps using my app.

  • 0

I want to allow users to add places to Google Maps using my app. This tutorial shows how to implement a Place Search https://developers.google.com/academy/apis/maps/places/basic-place-search I understand the code but Place Search and Place Add are different. In Place Add we have to use a POST URL and POST body https://developers.google.com/places/documentation/?hl=fr#adding_a_place. I don’t know how to insert POST body in my code. I want to use this code but to adapt it to Place Add:

import urllib2
import json

AUTH_KEY = 'Your API Key'

LOCATION = '37.787930,-122.4074990'

RADIUS = 5000

url = ('https://maps.googleapis.com/maps/api/place/search/json?location=%s'
     '&radius=%s&sensor=false&key=%s') % (LOCATION, RADIUS, AUTH_KEY)

response = urllib2.urlopen(url)

json_raw = response.read()
json_data = json.loads(json_raw)

if json_data[‘status’] == ‘OK’:
    for place in json_data['results']:
        print ‘%s: %s\n’ % (place['name'], place['reference'])'

EDIT

Thanks for your help @codegeek I finally find the solution based on this library https://github.com/slimkrazy/python-google-places

url = 'https://maps.googleapis.com/maps/api/place/add/json?sensor=false&key=%s' % AUTH_KEY
data = {
    "location": {
        "lat": 37.787930,
        "lng": -122.4074990
     },
     "accuracy": 50,
     "name": "Google Shoes!",
     "types": ["shoe_store"]
}
request = urllib2.Request(url, data=json.dumps(data))
response = urllib2.urlopen(request)
add_response = json.load(response)
if add_response['status'] != 'OK':
    # there is some error
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T07:15:17+00:00Added an answer on June 9, 2026 at 7:15 am

    If you read the urllib2 documentation at http://docs.python.org/library/urllib2, it clearly states the following:

    “urllib2.urlopen(url[, data][, timeout])

    data may be a string specifying additional data to send to the server,
    or None if no such data is needed. Currently HTTP requests are the
    only ones that use data; the HTTP request will be a POST instead of a
    GET when the data parameter is provided. data should be a buffer in
    the standard application/x-www-form-urlencoded format. The
    urllib.urlencode() function takes a mapping or sequence of 2-tuples
    and returns a string in this format”

    So, you need to call the urlopen function with data parameter which will then send the request through POST. Also. looking through the Google Places Add API page, you need to prepare the data which includes location, accruracy etc. urlencode() it and you should be good.
    If you want an example, see this gist at:
    https://gist.github.com/1841962#file_http_post_httplib.py

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to allow users of my application to add sub-users and set privileges
with this code, i want to add an image at the place the user
I want to be able to allow users to add their own options on
I am creating a web app, and within this app I want to allow
I want a widget that allows users to add a request if that request
I want to allow users to put in am img url instead of uploading
I want to allow users to either have there username field empty at any
I want to allow users to make their own Python mods for my game,
I want to allow users to select a local directory on a webpage (and
I have some labels that I want to allow users to edit. Is it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.