UNPKG

openapi-directory

Version:

Building & bundling https://github.com/APIs-guru/openapi-directory for easy use from JS

1 lines 6.17 kB
{"openapi":"3.0.0","servers":[{"url":""}],"info":{"contact":{"x-twitter":"amentumspace"},"description":"The gravitational field of the earth is non-uniform. The <a href='https://en.wikipedia.org/wiki/Geoid'>geoid</a> is the shape the\n ocean surface would take if only gravity and the rotation of the Earth\n were considered. The geoid is the surface that defines zero elevation.<br><br>\n\nThe geoid height is the difference between an ideal reference ellipsoid and the geoid.<br><br>\nThe gravity anomaly is the difference between the acceleration due to gravity on the Earth's surface and the value calculated assuming the reference ellipsoid.<br><br>\nThe official Earth Gravitational Model <a href=https://en.wikipedia.org/wiki/Earth_Gravitational_Model#EGM2008/>EGM2008</a> was developed and released to the public by the National Geospatial-Intelligence Agency (NGA).<br><br>\nOur EGM2008 API provides on-demand access to the EGM2008 model, as implemented by the open-source GeographicLib <a href=https://geographiclib.sourceforge.io/html/gravity.html>Gravity</a> library.<br><br>\nAPI requests must contain a key \"API-Key\" in the header (see code samples). Obtain a key from <a href='https://developer.amentum.io'>here</a>. <br><br> \nAmentum Pty Ltd is not responsible nor liable for any loss or damage of any sort incurred as a result of using the API. <br><br>\nCopyright <a href='https://amentum.space'>Amentum Pty Ltd</a> 2021.\n","title":"Gravity API","version":"1.1.1","x-apisguru-categories":["location","open_data"],"x-logo":{"altText":"Amentum Aerospace","backgroundColor":"#FFFFFF","url":"https://twitter.com/amentumspace/profile_image?size=original"},"x-origin":[{"format":"openapi","url":"https://gravity.amentum.space//openapi.json","version":"3.0"}],"x-providerName":"amentum.space","x-serviceName":"gravity"},"tags":[{"description":"Calculate geoid height and gravity anomaly values using the EGM2008 model\n","name":"egm2008","x-displayName":"EGM2008 API"}],"paths":{"/egm2008/geoid_height":{"get":{"description":"for a given latitude / longitude. \n","operationId":"app.api_egm2008.endpoints.EGM2008.calculate_height","parameters":[{"$ref":"#/components/parameters/Latitude"},{"$ref":"#/components/parameters/Longitude"}],"responses":{"200":{"content":{"application/json":{"example":{"height":{"units":"m","value":45.88107058892659}},"schema":{"$ref":"#/components/schemas/Height"}}},"description":"Successful geoid height calculation"}},"summary":"Calculate the geoid height\n","tags":["egm2008"],"x-codeSamples":[{"lang":"Shell","source":"curl -X GET \"https://gravity.amentum.io/egm2008/geoid_height?latitude=-45&longitude=45\" -H \"API-Key: <your_key>\" -H \"accept: application/json\"\n"},{"lang":"Python","source":"import requests\n\nheaders = {\"API-Key\" : \"<add_your_key>\"}\n\nparams = {\n \"latitude\" : \"-45\",\n \"longitude\" : \"45\"\n}\n\n# Make the API call\ntry:\n response = requests.get(\n \"https://gravity.amentum.io/egm2008/geoid_height\",\n params=params, headers=headers)\n response_json = response.json()\n response.raise_for_status()\nexcept requests.exceptions.HTTPError as e:\n print(response_json['error'])\nelse:\n # Extract the height\n height = response_json['height']['value']\n h_unit = response_json['height']['units']\n print(\"Height: \", height, h_unit)\n"}]}},"/egm2008/gravity_anomaly":{"get":{"description":"for a given latitude / longitude.\n","operationId":"app.api_egm2008.endpoints.EGM2008.calculate_anomaly","parameters":[{"$ref":"#/components/parameters/Latitude"},{"$ref":"#/components/parameters/Longitude"}],"responses":{"200":{"content":{"application/json":{"example":{"eta":{"units":"arcsec","value":-0.9413662219916251},"gravity_anomaly":{"units":"mGal","value":27.954737031742376},"xi":{"units":"arcsec","value":1.371151956763653}},"schema":{"$ref":"#/components/schemas/Anomaly"}}},"description":"Successful anomaly calculation"}},"summary":"Calculate gravity anomaly values\n","tags":["egm2008"],"x-codeSamples":[{"lang":"Shell","source":"curl -X GET \"https://gravity.amentum.io/egm2008/gravity_anomaly?latitude=-45&longitude=45\" -H \"API-Key: <your_key>\" -H \"accept: application/json\"\n"},{"lang":"Python","source":"import requests\n\nheaders = {\"API-Key\" : \"<add_your_key>\"}\n\nparams = {\n \"latitude\" : \"-45\",\n \"longitude\" : \"45\"\n}\n\n# Make the API call\ntry:\n response = requests.get(\n \"https://gravity.amentum.io/egm2008/gravity_anomaly\",\n params=params, headers=headers)\n response_json = response.json()\n response.raise_for_status()\nexcept requests.exceptions.HTTPError as e:\n print(response_json['error'])\nelse:\n # Extract eta\n eta = response_json['eta']['value']\n e_unit = response_json['eta']['units']\n print(\"Eta: \", eta, e_unit)\n\n # Extract gravity anomaly\n ga = response_json['gravity_anomaly']['value']\n ga_unit = response_json['gravity_anomaly']['units']\n print(\"Gravity Anomaly: \", ga, ga_unit)\n\n # Extract xi\n xi = response_json['xi']['value']\n xi_unit = response_json['xi']['units']\n print(\"Xi: \", xi, xi_unit)\n"}]}}},"components":{"parameters":{"Latitude":{"description":"Geographic latitude (-90 to 90 deg).","in":"query","name":"latitude","required":true,"schema":{"example":-45,"type":"number"}},"Longitude":{"description":"Geographic longitude (-180 to 180 deg).","in":"query","name":"longitude","required":true,"schema":{"example":45,"type":"number"}}},"schemas":{"Anomaly":{"properties":{"eta":{"description":"Eta (arcsec) - easterly component of deflection of vertical.","properties":{"units":{"type":"string"},"value":{"type":"number"}},"type":"object"},"gravity_anomaly":{"description":"Gravity anomaly (mGal)\n","properties":{"units":{"type":"string"},"value":{"type":"number"}},"type":"object"},"xi":{"description":"Xi (arcsec) - northerly component of deflection of vertical.\n","properties":{"units":{"type":"string"},"value":{"type":"number"}},"type":"object"}},"type":"object"},"Height":{"properties":{"height":{"description":"Geoid height (m)\n","properties":{"units":{"type":"string"},"value":{"type":"number"}},"type":"object"}},"type":"object"}}}}