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 8839533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:15:28+00:00 2026-06-14T10:15:28+00:00

I am working with the Directions API using python. mapApi = GoogleMaps(API_KEY) directionsObj.routes =

  • 0

I am working with the Directions API using python.

mapApi = GoogleMaps(API_KEY)
directionsObj.routes = mapApi.directions(directionsObj.source, directionsObj.destination)
print "directionsObj.routesssss", directionsObj.routes['routes']

I used the above code to get the Json response file of Directions API and I stored the Json to mongoengine(the database used). Now in the terminal I get the following result when I run the above code.

Json file:

[{u'overview_polyline': {u'points': u'yiv{@a~~pMPv@KDRnAfAdHeBl@o@ZaAh@}Bx@}CdAyBn@oDfAgEtAv@pEpBbLlBnItCxMlBlHdBpGzB|HXhAl@tBXv@`@`AoAr@iKbF{CxAcAl@]T_@^Q^GVIf@UdAO`@[j@YXo@b@aCrAsAn@{IhD{At@yCfBqAv@_@\\kAxByErKeB|DKR_CzCsBhCcAfAk@h@[Re@Js@JgD\\aBFeAAcAIq@OqAe@}@Qg@Ce@Bs@Ls@Ts@r@s@~@k@hAmCHeDDkAFsBJkI`@_BJyG\\s^bB}QvAa\\xCcEZaGl@yCV_Q~ABNh@Et@bBDVCJ?XL|@X`AXz@Rd@^r@`@t@X|@F^Dt@Jt@Xf@NTPl@Ff@?j@VnBJr@I@MFu@d@YPy@\\{Bl@}Aj@e@Vw@`@WFW@c@?a@E{@IU?q@JwB`@oB`@cARyABaCFs@FaAJOBbAnE?VEl@E^BRvAfCJJLFjAf@QDgEbAqAPoB^}@JkAReCl@iAZsBZGDCJDh@EDaD^Rv@b@bC\\tBVxB\\xCPdAPl@\\jAXv@zBvChAtAr@~@dCpC'}, u'copyrights': u'Map data \xa92012 Google', u'warnings': [], u'legs': [{u'distance': {u'text': u'11.1 km', u'value': 11118}, u'end_address': u'Kaloor, Ernakulam, Kerala, India', u'via_waypoint': [], u'start_address': u'Thrippunithura, Kerala, India', u'duration': {u'text': u'19 mins', u'value': 1126}, u'steps': [{u'html_instructions': u'Head west', u'distance': {u'text': u'33 m', u'value': 33}, u'polyline': {u'points': u'yiv{@a~~pMPv@'}, u'travel_mode': u'DRIVING', u'start_location': {u'lat': 9.949890000000002, u'lng': 76.34929000000001}, u'duration': {u'text': u'1 min', u'value': 4}, u'end_location': {u'lat': 9.949800000000003, u'lng': 76.34901}}, {u'html_instructions': u'Turn right toward Ernakulam-Ettumanoor Rd/SH 15', u'distance': {u'text': u'8 m', u'value': 8}, u'polyline': {u'points': u'giv{@i|~pMKD'}, u'travel_mode': u'DRIVING', u'start_location': {u'lat': 9.949800000000003, u'lng': 76.34901}, u'duration': {u'text': u'1 min', u'value': 11}, u'end_location': {u'lat': 9.949860000000001, u'lng': 76.34898000000001}}, {u'html_instructions': u'Take the 1st left toward Ernakulam-Ettumanoor Rd/SH 15', u'distance': {u'text': u'0.2 km', u'value': 211}, u'polyline': {u'points': u'siv{@c|~pMJp@F\\D\\RjA^|BL|@'}, u'travel_mode': u'DRIVING', u'start_location': {u'lat': 9.949860000000001, u'lng': 76.34898000000001}, u'duration': {u'text': u'1 min', u'value': 28}, u'end_location': {u'lat': 9.949400000000002, u'lng': 76.34711}}, {u'html_instructions': u'Turn right onto Ernakulam-Ettumanoor Rd/SH 15Pass by Abhayam (on the right in 400m)', u'distance': {u'text': u'0.6 km', u'value': 608}, u'polyline': {u'points': u'wfv{@mp~pMcA\\a@N[NSJg@VYP[LaBj@m@PoBr@{@V}@V}Bp@q@T]JiDhA'}, u'travel_mode': u'DRIVING', u'start_location': {u'lat': 9.949400000000002, u'lng': 76.34711}, u'duration': {u'text': u'1 min', u'value': 71}, u'end_location': {u'lat': 9.95439, u'lng': 76.34486000000001}}, {u'html_instructions': u'Turn left at SN Jct onto Kochi - Madurai - Tondi Point Hwy/Kochi - Madurai - Tondi Point Highway/NH 85Pass by ICICI Bank (on the left)', u'distance': {u'text': u'1.5 km', u'value': 1536}, u'polyline': {u'points': u'}ew{@kb~pM@D^xBTnA?@pB`L?@x@xDr@tCJf@x@zDJd@bAnEj@xBBJDNv@vCT|@b@|ABJf@hB~@zCz@`DJ\\Lj@^rAL`@JXL\\FRXl@'}, u'travel_mode': u'DRIVING', u'start_location': {u'lat': 9.95439, u'lng': 76.34486000000001}, u'duration': {u'text': u'2 mins', u'value': 112}, u'end_location': {u'lat': 9.949900000000001, u'lng': 76.33162}}, {u'html_instructions': u'Turn right at Petta Jct onto Ernakulam Ettumanoor Rd', u'distance': {u'text': u'54 m', u'value': 54}, u'polyline': {u'points': u'{iv{@so{pMo@^_@R'}, u'travel_mode': u'DRIVING', u'start_location': {u'lat': 9.949900000000001, u'lng': 76.33162}, u'duration': {u'text': u'1 min', u'value': 59}, u'end_location': {u'lat': 9.9503, u'lng': 76.33136}}, {u'html_instructions': u'Continue onto SH 15 Ernakulam -Ettumanoor HwyPass by Reliance Petrol Pump (on the right in 1.5km)', u'distance': {u'text': u'2.5 km', u'value': 2516}, u'polyline': {u'points': u'klv{@_n{pMuBbAcBx@uBbAy@`@OFqAn@g@TQJWLOJQJIFEBC@KHGDGFGFGDGHEFEHA@CJEJAJEPCTKh@IZGRGLIPGHABGJIHONIFe@ZMFe@Vi@Zc@VQHULSHWLs@XaEzA{An@IBe@Tu@^}@h@{A|@WNMHYPQJKHKHCBCDEFKP]n@[n@e@dAQ\\s@`BmBlEg@hAe@dAO\\GNEHEHEFyBrCmA~Ae@h@_@`@c@d@[XONKHOHSDQDWF[BcALcBNy@Bg@Bi@?[A]Ce@E]GSGk@Se@QOESEMCKAUAQAS@Q@YDYFWH[J'}, u'travel_mode': u'DRIVING', u'start_location': {u'lat': 9.9503, u'lng': 76.33136}, u'duration': {u'text': u'3 mins', u'value': 153}, u'end_location': {u'lat': 9.967500000000001, u'lng': 76.31912000000001}}, {u'html_instructions': u'Continue onto Sahodaran Ayyappan Rd', u'distance': {u'text': u'0.1 km', u'value': 134}, u'polyline': {u'points': u'{wy{@oaypMGHIFQPONKJQTKNILa@t@IR'}, u'travel_mode': u'DRIVING', u'start_location': {u'lat': 9.967500000000001, u'lng': 76.31912000000001}, u'duration': {u'text': u'1 min', u'value': 59}, u'end_location': {u'lat': 9.968240000000002, u'lng': 76.31817000000001}}, {u'html_instructions': u'Turn right at Vyttila Jct onto NH 66Pass by Muthoot Motors (on the left in 1.6km)', u'distance': {u'text': u'2.8 km', u'value': 2771}, u'polyline': {u'points': u'o|y{@q{xpMS?yBHeDDkAFm@BeAFgCJcEToAHO@yEVo@DC?K?q@DK@qLh@cOp@wIn@OB}ALwCTmNpA{D\\qEb@e@DcEZaGl@sAJeAJuALcFb@yEd@k@F'}, u'travel_mode': u'DRIVING', u'start_location': {u'lat': 9.968240000000002, u'lng': 76.31817000000001}, u'duration': {u'text': u'3 mins', u'value': 205}, u'end_location': {u'lat': 9.99295, u'lng': 76.31493}}, {u'html_instructions': u'Turn left toward NH66 Service Road', u'distance': {u'text': u'9 m', u'value': 9}, u'polyline': {u'points': u'}v~{@igxpM?@BL'}, u'travel_mode': u'DRIVING', u'start_location': {u'lat': 9.99295, u'lng': 76.31493}, u'duration': {u'text': u'1 min', u'value': 11}, u'end_location': {u'lat': 9.992930000000001, u'lng': 76.31485}}, {u'html_instructions': u'Turn left onto NH66 Service Road', u'distance': {u'text': u'24 m', u'value': 24}, u'polyline': {u'points': u'yv~{@yfxpMd@EB?'}, u'travel_mode': u'DRIVING', u'start_location': {u'lat': 9.992930000000001, u'lng': 76.31485}, u'duration': {u'text': u'1 min', u'value': 11}, u'end_location': {u'lat': 9.99272, u'lng': 76.31488}}, {u'html_instructions': u'Take the 1st right onto Puthiya Rd', u'distance': {u'text': u'0.6 km', u'value': 621}, u'polyline': {u'points': u'ou~{@_gxpMBFh@jABHBD@F@F?D@@?@?@A@AD?B?F?D?F?D@BHj@@F?BDJHVHXPh@FPHTHNP^LRRXLZFPDJDLDPBLBPB\\@V@N@LBJBJ@BFJHLDHBFJLFTHV@F@B@L@L?H?J?H?J@NBTLv@BPJr@'}, u'travel_mode': u'DRIVING', u'start_location': {u'lat': 9.99272, u'lng': 76.31488}, u'duration': {u'text': u'1 min', u'value': 51}, u'end_location': {u'lat': 9.990900000000002, u'lng': 76.30962000000001}}, {u'html_instructions': u'Turn right at Puthiya Road Junction onto Thammanam RdPass by Thammanam Mosque (on the left)', u'distance': {u'text': u'0.6 km', u'value': 623}, u'polyline': {u'points': u'cj~{@cfwpMI@GBEBOJOHIFKFKHMFg@RQHWH[Ha@He@No@Tm@TYNKFQHSLGBIDMBIBK@K?S?O?OAQC]E]CIAK@I@OBMBI@_APw@NoAT_@JQDYFKBK@S?'}, u'travel_mode': u'DRIVING', u'start_location': {u'lat': 9.990900000000002, u'lng': 76.30962000000001}, u'duration': {u'text': u'2 mins', u'value': 98}, u'end_location': {u'lat': 9.996120000000001, u'lng': 76.30793000000001}}, {u'html_instructions': u'Continue onto Mahakavi Vailoppilli Rd', u'distance': {u'text': u'0.2 km', u'value': 187}, u'polyline': {u'points': u'wj_|@q{vpMa@@Q?Q@eBB[BYBYB_@Da@DOB'}, u'travel_mode': u'DRIVING', u'start_location': {u'lat': 9.996120000000001, u'lng': 76.30793000000001}, u'duration': {u'text': u'1 min', u'value': 42}, u'end_location': {u'lat': 9.99779, u'lng': 76.30775000000003}}, {u'html_instructions': u'Turn left onto Indira Road', u'distance': {u'text': u'0.3 km', u'value': 343}, u'polyline': {u'points': u'eu_|@mzvpMbAnE@JAJC^ALEX?D@F@JBFrA~BDDDDFBDBjAf@'}, u'travel_mode': u'DRIVING', u'start_location': {u'lat': 9.99779, u'lng': 76.30775000000003}, u'duration': {u'text': u'1 min', u'value': 45}, u'end_location': {u'lat': 9.996540000000001, u'lng': 76.30512}}, {u'html_instructions': u'Turn right onto St. Martin Road', u'distance': {u'text': u'0.6 km', u'value': 641}, u'polyline': {u'points': u'km_|@_jvpMQDgEbAqAP_@FoAVI@s@HkAReCl@m@P[Hc@HoAPC@CBADADDb@?DABC@aD^'}, u'travel_mode': u'DRIVING', u'start_location': {u'lat': 9.996540000000001, u'lng': 76.30512}, u'duration': {u'text': u'1 min', u'value': 89}, u'end_location': {u'lat': 10.00178, u'lng': 76.30334}}, {u'html_instructions': u'Turn left at Worldwide IPR Services onto NH 47Pass by Juma Masjid (on the left)Destination will be on the left', u'distance': {u'text': u'0.8 km', u'value': 799}, u'polyline': {u'points': u'cn`|@{~upMRv@RnANr@BRX`BRxAB^D`@P~ABP@DF^Hd@@DNf@Rp@HXHXN\\`@j@xAjBJL|@fAr@~@dCpC'}, u'travel_mode': u'DRIVING', u'start_location': {u'lat': 10.00178, u'lng': 76.30334}, u'duration': {u'text': u'1 min', u'value': 77}, u'end_location': {u'lat': 9.998700000000001, u'lng': 76.29695000000001}}], u'start_location': {u'lat': 9.949890000000002, u'lng': 76.34929000000001}, u'end_location': {u'lat': 9.998700000000001, u'lng': 76.29695000000001}}], u'bounds': {u'northeast': {u'lat': 10.00178, u'lng': 76.34929000000001}, u'southwest': {u'lat': 9.949400000000002, u'lng': 76.29695000000001}}, u'waypoint_order': [], u'summary': u'NH 66'}]

How to parse the above Json file so that I can get only the start_address,end_address, u'html_instructions only.

  • 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-14T10:15:30+00:00Added an answer on June 14, 2026 at 10:15 am

    This code worked for geting the start_address,end_address, html_instructions:

    for leg in directionsObj.route['legs']:
        startAddress = leg['start_address']
        print "Start Address:", startAddress
        endAddress = leg['end_address']
        print "End Address:", endAddress
        for step in leg['steps']:
            html_instructions = step['html_instructions']
            print "html instructions", html_instructions
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working with google map api ... http://code.google.com/p/gmaps-samples-flash/source/browse/trunk/samplecode/GeocodingSimple.mxml What i want to do
I'm working on a project, written in AS3. I'm using the Google Maps API
I'm working on an RPG for Android, using the LunarLander API demo. I've already
I'm making an app for android, I'm using Google Directions API to get and
I am working on some code using Google Maps API. To sum up shortly,
I am working on a app which requires me to store some directions for
Working on a small game using an HTML5 canvas, and javascript. And it's working
Working with an undisclosed API, I found a function that can set the number
I have a question regarding map api. I was using the the google map
I've been working with the SpiderMonkey C API and would like to implement a

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.