API request

    0

    0

    Géraldine Geoffroy

    url: "http://data.portic.fr/api/travels" headers: {'Accept': 'application/json'} params: {'params': 'travel_id,travel_rank,departure_uhgs_id,departure,departure_latitude,departure_longitude,departure_admiralty,departure_province,destination_uhgs_id,destination,destination_latitude,destination_longitude,destination_admiralty,destination_province,ship_id,ship_name,ship_flag_standardized_fr,tonnage,tonnage_class,outdate_fixed', 'shortenfields': 'false', 'both_to': 'false', 'date': '1787'} data: {'travel_id': '1668', 'travel_rank': 1, 'departure_uhgs_id': '24999', 'departure': '2017-11-14 14:05:00', 'departure_latitude': 46.5167, 'departure_longitude': -5

    import requests
    import json
    
    url = "http://data.portic.fr/api/travels"
    
    headers = {'Accept': 'application/json'}
    params = {'params': 'travel_id,travel_rank,departure_uhgs_id,departure,departure_latitude,departure_longitude,departure_admiralty,departure_province,destination_uhgs_id,destination,destination_latitude,destination_longitude,destination_admiralty,destination_province,ship_id,ship_name,ship_flag_standardized_fr,tonnage,tonnage_class,outdate_fixed',
      'shortenfields': 'false',
      'both_to': 'false',
      'date': '1787'}
    
    response = requests.request("GET", url, headers=headers, params=params)
    data = json.loads(response.text)
    df = pd.DataFrame(data)
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.