Learn How to Send Requests to the Google Maps API With Python

Поділитися
Вставка
  • Опубліковано 12 лис 2024

КОМЕНТАРІ • 38

  • @prettyprinted
    @prettyprinted  6 років тому +1

    Want to learn more about requests in Python? Check out my course at learnpythonrequests.com

    • @Label_Reader
      @Label_Reader 6 років тому

      Where is your one on one training option . The info flag leads to an empty page ? Thanks ! :-)

    • @tushardeshpande6955
      @tushardeshpande6955 5 років тому

      Bro m getting IndexError : list index out of range at place_id

    • @sailytaskar4147
      @sailytaskar4147 5 років тому

      @@tushardeshpande6955 did you get solution for this error? I am getting same error.

  • @prettyprinted
    @prettyprinted  7 років тому +1

    Thanks for watching everyone! Check out PrettyPrinted.com for Python web development courses: prettyprinted.com

  • @saivasanth8819
    @saivasanth8819 6 років тому +1

    Hello i have executed the same code , but by clicking on the result , it was reloading the same page , i don't know what to do , so please help me on this issue

    • @董锦凝
      @董锦凝 6 років тому

      I'm getting the same situation here, have you ever fixed that problem?

  • @tushardeshpande6955
    @tushardeshpande6955 5 років тому +3

    Bro m getting IndexError : list index out of range at place_id

  • @chaitalibansal9557
    @chaitalibansal9557 7 років тому +1

    Can u teach about how to extract data from google maps in a csv file?

    • @prettyprinted
      @prettyprinted  7 років тому

      I can cover that eventually. I'll add it to my list of videos to make.

  • @111marmotman
    @111marmotman 9 років тому +2

    Very nice! Thanks!

    • @prettyprinted
      @prettyprinted  9 років тому

      +Josh Arnold Thank you for watching.

  • @haliu9750
    @haliu9750 6 років тому

    Thanks for your great explanation. I tried to run the script, but I came across a problem that "
    File "C:\Users\Yining\Anaconda3\lib\site-packages\click\utils.py", line 259, in echo
    file.write(message) UnsupportedOperation: Not writable" I don't know how to solve it. Really appreciate your help. Thx.

    • @prettyprinted
      @prettyprinted  6 років тому

      Do you have permissions to write into the folder? And what exactly are you trying to write to a file?

    • @haliu9750
      @haliu9750 6 років тому

      I tried to run the script with Command Prompt and this problem was solved. Sorry for interrupting. Thank you sincerely anyway.

  • @mohamedfliss3734
    @mohamedfliss3734 8 років тому

    Hi, thank you for the explanation but how could someone get eventually to the url, if there is, for e.g., no parameter called 'url' in the response?

    • @prettyprinted
      @prettyprinted  8 років тому

      I'm not sure I understand. As long as you know what the response is supposed to look like (by reading the docs), you'll know if the url should be in the response.

    • @mohamedfliss3734
      @mohamedfliss3734 8 років тому

      I am trying to generate a path on the Google Maps Directions API.
      I already made the request but there is no parameter "url" in the response.
      And in the API, the "directionrendering" function only exists for JavaScript...

    • @prettyprinted
      @prettyprinted  8 років тому

      Oh, that's a limitation of the Google Maps API. I'm not too familiar with it, but it doesn't look like you can pull up a map with directions already set like you can pull up a place like I'm doing in the video.

  • @RachelHaines
    @RachelHaines 6 років тому

    Hi ! I'm a newbie, so please forgive me if I overlooked something simple... I'm running Python 3.6.4 with flask and requests installed. I have my own API Key in the key.py file. I tried to type my own code following along with your video... but couldn't make it work. So I downloaded your code and ran it from the CMD console ("python api_example.py"). When I do this I get a "restart" message followed by "Debugger is active!", "Debugger PIN: 321-412-329", and "Running on 127.0.0.1:500/" messages. When I load layout.html in Chrome I can enter a place into the search box but the URL link does not change. I'm thinking that either I did not start the .py properly or I do not have some necessary package installed ? Your help would be appreciated ! Thanks !

    • @prettyprinted
      @prettyprinted  6 років тому

      You have the app part working correct. What you saw is normal.
      I'm not sure if this still works though because I made it over two years ago. Try inspecting the result of the API call like I do in the video and see if you get anything in return.

  • @sailytaskar4147
    @sailytaskar4147 5 років тому +1

    I am getting this error
    place_id = search_json["results"][0]["place_id"]
    IndexError: list index out of range
    Can you please help me with this error?

    • @prettyprinted
      @prettyprinted  5 років тому

      The API isn't returning exactly what you want. You have to look at what the raw API response data to determine what's missing.

  • @tsh9997
    @tsh9997 6 років тому

    good tutorial
    how can i get my location from google map, via python ? anyone can help me ?

  • @kotic007
    @kotic007 8 років тому

    Are you running the google service details api on localhost? I'm getting an server error - not able to find url, even when I use the google client api key in the key.py file

    • @prettyprinted
      @prettyprinted  8 років тому

      +kotic007 Yeah I was running on localhost. It may be because Google changed their API recently. I'll be making another video soon that uses the updated API.

    • @kotic007
      @kotic007 8 років тому

      I actually got it working - I created a new project in google, and enabled the google maps api for that project :)

    • @prettyprinted
      @prettyprinted  8 років тому

      +kotic007 Cool, I'm glad it works. Thanks for watching!

    • @kotic007
      @kotic007 8 років тому

      Yes I like your tutorials a lot - please keep it coming - it's very applicable to the type of work I want to do. Best

    • @prettyprinted
      @prettyprinted  8 років тому

      +kotic007 I'm glad you like them, and I won't stop making them!

  • @vishalparkar
    @vishalparkar 5 років тому

    Liked your style of presentation! Wish to rebuild a complete ERP for my engineering education institute in Python Flask, the part of which I have already developed using the UserSpice framework of PHP with some additions and modifications. Here apart from the user management, everything else has to be coded explicitly and is thus time-consuming. So, for quick development, I wish to change the whole technology to Flask framework. Rather than building from scratch, I wish to know if there is some flask app similar to userspice (userspice.com/
    ) or usercake framework in PHP used for user management with permissions? I've heard of the User extension of Flask but want to know whether it can be modified to allow invited registrations only where only those users who have been invited by a pre-existing authority using their emails as opposed to the open registrations allowed in the User extension. I'm a newbie in Flask!

    • @prettyprinted
      @prettyprinted  5 років тому +1

      Yes, Flask-User or Flask-Security will work for you, but you'll have to write some additional code to get the functionality you want.

    • @vishalparkar
      @vishalparkar 5 років тому

      @@prettyprinted Thank you! But may you please tell me the difference between flask-login, flask-user & flask-security?

    • @prettyprinted
      @prettyprinted  5 років тому

      @@vishalparkar I recommend looking at the documentation for each because they explain everything I could say. Try them all out and see which one works for you.

  • @UmarYusuf
    @UmarYusuf 7 років тому

    Good tut

  • @jamirhuamancampos
    @jamirhuamancampos 7 років тому

    Acá dejo un pequeño ejemplo actualizado:
    librodememorias.wordpress.com/2017/09/19/creacion-de-un-proyecto-con-django-google-maps/