The Earth's magnetic field is generated by electric currents in the molten outer core and, to a lesser extent, affected by local variations in the mantle and crust. The magnetic field varies with position and time on and above the surface (the magnetic poles are drifting).
The World Magnetic Model predicts the intensity and direction of Earth's magnetic field on a specific decimal year, geodetic altitude, latitude, and longitude. It was developed jointly by the US National Geophysical Data Center and the British Geological Survey and is relied upon throughout the world for navigation, mineral exploration, atmospheric and space science.
Our web API provides access to the World Magnetic Model and is valid for the period 2015-2025.
Curl Example
Below is a sample code to run:
curl --location --request \
GET 'https://api.promptapi.com/geomagnetism?altitude=20&latitude=80&longitude=100&year=2020.5' \
--header 'apikey: YOUR API KEY'
The response is self explanotory. See below:
{
"declination": {
"units": "Deg",
"value": 33.6334114074707
},
"grid_variation": {
"units": "Deg",
"value": -66.36659240722656
},
"inclination": {
"units": "Deg",
"value": 87.94071960449219
},
"total_intensity": {
"units": "nT",
"value": 58142.8359375
}
}