{"id":18376,"date":"2021-04-28T09:22:51","date_gmt":"2021-04-28T09:22:51","guid":{"rendered":"http:\/\/wiki2.plumserver.com\/?post_type=ht_kb&#038;p=18376"},"modified":"2026-03-12T03:37:16","modified_gmt":"2026-03-12T07:37:16","slug":"magento-2-ip-geolocation-lookup-v1-x-rest-api-reference","status":"publish","type":"post","link":"https:\/\/plumrocket.com\/docs\/magento-ip-geolocation-lookup\/v1\/devguide\/rest-api","title":{"rendered":"Magento 2 IP Geolocation Lookup v1.x REST API Reference"},"content":{"rendered":"\n<p>GeoIP Lookup REST API allows you to integrate your own development with the <a href=\"\/magento-geoip-lookup\">IP Geolocation Lookup module<\/a> using the REST API. To access the REST API, you need to take the following steps:<\/p>\n\n\n\n<h2 id=\"h-step-1-open-access-to-the-api\">Step 1. Open Access to the API<\/h2>\n\n\n\n<ol><li>In the Magento backend main menu, go to <strong>System &gt; Extensions &gt; Integrations &gt; New Integration &gt; API<\/strong>.<\/li><li>Select <strong>Plumrocket <\/strong>&gt; <strong>IP Geolocation Lookup<\/strong>. <\/li><li>Save changes.<\/li><li>Flush cache.<\/li><\/ol>\n\n\n\n<figure class=\"wp-block-image\"><img alt=\"\"\/><\/figure>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container\">\n<h2 id=\"h-step-2-make-a-get-request-to-the-api-on-ip-address\">Step 2. Make a GET Request to the API on IP address<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">URL http:\/\/<mark>www.YourSite.com<\/mark>\/rest\/V1\/prgeoiplookup\/<mark>8.8.8.8<\/mark>.<\/pre>\n\n\n\n<p><mark><em>8.8.8.8<\/em><\/mark> is an IP address from which we want to retrieve data.<br><mark><em>www.YourSite.com<\/em><\/mark> is your website&#8217;s IP address.<\/p>\n\n\n\n<p>By default, the data will be returned in XML format. To get JSON, you need to specify the data type \u201capplication\/json\u201d in the request header.<\/p>\n<\/div><\/div>\n\n\n\n<h3 id=\"h-example-1-return-all-available-information-of-an-ip-address-using-rest-api-data-type-in-response-xml\">Example 1. Return all available information of an IP address using REST API. Data type in response &#8211; XML<\/h3>\n\n\n\n<p>As an example, we use the 8.8.8.8 IP address:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-http\">GET http:\/\/www.YourSite.com\/rest\/V1\/prgeoiplookup\/8.8.8.8\/<\/code><\/pre><\/div>\n\n\n\n<p>Request Headers:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">GET \/rest\/V1\/prgeoiplookup\/8.8.8.8\nHost: <mark>www.YourSite.com<\/mark>\nAccept: *\/*\nUser-Agent: Mozilla\/5.0 (compatible; Rigor\/1.0.0; http:\/\/rigor.com)<\/pre>\n\n\n\n<p>Response Body:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-markup\">&lt;response>\n\t&lt;item>\n\t\t&lt;latitude>37.7510&lt;\/latitude>\n\t\t&lt;longitude>-97.8220&lt;\/longitude>\n\t\t&lt;continent_code>NA&lt;\/continent_code>\n\t\t&lt;continent_name>North America&lt;\/continent_name>\n\t\t&lt;country_code>US&lt;\/country_code>\n\t\t&lt;country_name>United States&lt;\/country_name>\n\t\t&lt;is_in_european_union>false&lt;\/is_in_european_union>\n\t\t&lt;database_name>Maxmind&lt;\/database_name>\n\t&lt;\/item>\n&lt;\/response><\/code><\/pre><\/div>\n\n\n\n<h3 id=\"h-example-2-return-all-available-information-of-an-ip-address-using-rest-api-data-type-in-response-json\">Example 2. Return all available information of an IP address using REST API. Data type in response &#8211; JSON<\/h3>\n\n\n\n<p>As an example, we use the 8.8.8.8 IP address:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-http\">GET http:\/\/www.YourSite.com\/rest\/V1\/prgeoiplookup\/8.8.8.8\/<\/code><\/pre><\/div>\n\n\n\n<p>Request Headers:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">GET \/rest\/V1\/prgeoiplookup\/8.8.8.8\nHost: <mark>www.YourSite.com<\/mark>\nAccept: *\/*\nUser-Agent: Mozilla\/5.0 (compatible; Rigor\/1.0.0; http:\/\/rigor.com)\nContent-Type: application\/json<\/pre>\n\n\n\n<p>Response Body:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-json\">[{\"latitude\":\"37.7510\",\"longitude\":\"-97.8220\",\"continent_code\":\"NA\",\"continent_name\":\"North America\",\"country_code\":\"US\",\"country_name\":\"United States\",\"is_in_european_union\":false,\"database_name\":\"Maxmind\"}]<\/code><\/pre><\/div>\n\n\n\n<p>In the REST API request, you can also specify the priority of using databases. By default, the sequence is as follows: Maxmind, IpToCountry, IpApi. In the REST API link, the services are specified after the IP parameter and are separated by commas (see Example 3).<\/p>\n\n\n\n<h3 id=\"h-example-3-return-all-available-information-of-an-ip-address-using-rest-api-and-specifying-the-priority-of-using-services\">Example 3. Return all available information of an IP address using REST API and specifying the priority of using services<\/h3>\n\n\n\n<p>As an example, we use the 8.8.8.8 IP address:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-http\">GET http:\/\/www.YourSite.com\/rest\/V1\/prgeoiplookup\/8.8.8.8\/ipapi,maxmind,iptocountry\/<\/code><\/pre><\/div>\n\n\n\n<p>Request Headers:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">GET \/rest\/V1\/prgeoiplookup\/8.8.8.8\/ipapi,maxmind,iptocountry\/\nHost: www.YourSite.com\nAccept: *\/*\nUser-Agent: Mozilla\/5.0 (compatible; Rigor\/1.0.0; http:\/\/rigor.com)<\/pre>\n\n\n\n<p>Response Body:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-markup\">&lt;response>\n\t&lt;item>\n\t\t&lt;country_code>US&lt;\/country_code>\n\t\t&lt;country_name>United States&lt;\/country_name>\n\t\t&lt;latitude>37.751&lt;\/latitude>\n\t\t&lt;longitude>-97.822&lt;\/longitude>\n\t\t&lt;database_name>Ipapi.Com&lt;\/database_name>\n\t\t&lt;is_in_european_union>false&lt;\/is_in_european_union>\n\t&lt;\/item>\n&lt;\/response><\/code><\/pre><\/div>\n\n\n\n<p><strong>You can also specify more than one service after the IP parameter when making a REST API request<\/strong>:<\/p>\n\n\n\n<p>Let&#8217;s only use the ipapi service in the following request example:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-http\">GET http:\/\/www.YourSite.com\/rest\/V1\/prgeoiplookup\/8.8.8.8\/ipapi\/<\/code><\/pre><\/div>\n\n\n\n<p>Let&#8217;s use ipapi and IpToCountry services in the following request example:<\/p>\n\n\n\n<div class=\"wp-block-prismatic-blocks\"><div><\/div><pre><code class=\"language-http\">GET http:\/\/www.YourSite.com\/rest\/V1\/prgeoiplookup\/8.8.8.8\/ipapi,iptocountry\/<\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>GeoIP Lookup REST API allows you to integrate your own development with the IP Geolocation Lookup module using the REST API. To access the REST API, you need to take the following steps: Step 1. Open Access to the API In the Magento backend main menu, go to System &gt; Extensions &gt; Integrations &gt; New &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/plumrocket.com\/docs\/magento-ip-geolocation-lookup\/v1\/devguide\/rest-api\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Magento 2 IP Geolocation Lookup v1.x REST API Reference&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[200],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v17.2 (Yoast SEO v17.2) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Magento 2 IP Geolocation Lookup v1.x REST API Reference - Plumrocket Documentation<\/title>\n<meta name=\"description\" content=\"GeoIP Lookup REST API allows you to integrate your own development with the IP Geolocation Lookup module using the REST API. To access the REST API, you\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/plumrocket.com\/docs\/magento-ip-geolocation-lookup\/v1\/devguide\/rest-api\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Magento 2 IP Geolocation Lookup v1.x REST API Reference\" \/>\n<meta property=\"og:description\" content=\"GeoIP Lookup REST API allows you to integrate your own development with the IP Geolocation Lookup module using the REST API. To access the REST API, you\" \/>\n<meta property=\"og:url\" content=\"https:\/\/plumrocket.com\/docs\/magento-ip-geolocation-lookup\/v1\/devguide\/rest-api\" \/>\n<meta property=\"og:site_name\" content=\"Plumrocket Documentation\" \/>\n<meta property=\"article:published_time\" content=\"2021-04-28T09:22:51+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-03-12T07:37:16+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Plumrocket\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Magento 2 IP Geolocation Lookup v1.x REST API Reference - Plumrocket Documentation","description":"GeoIP Lookup REST API allows you to integrate your own development with the IP Geolocation Lookup module using the REST API. To access the REST API, you","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/plumrocket.com\/docs\/magento-ip-geolocation-lookup\/v1\/devguide\/rest-api","og_locale":"en_US","og_type":"article","og_title":"Magento 2 IP Geolocation Lookup v1.x REST API Reference","og_description":"GeoIP Lookup REST API allows you to integrate your own development with the IP Geolocation Lookup module using the REST API. To access the REST API, you","og_url":"https:\/\/plumrocket.com\/docs\/magento-ip-geolocation-lookup\/v1\/devguide\/rest-api","og_site_name":"Plumrocket Documentation","article_published_time":"2021-04-28T09:22:51+00:00","article_modified_time":"2026-03-12T07:37:16+00:00","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Plumrocket","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/plumrocket.com\/docs\/#website","url":"https:\/\/plumrocket.com\/docs\/","name":"Plumrocket Documentation","description":"Extensions docs, troubleshootings etc.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/plumrocket.com\/docs\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/plumrocket.com\/docs\/magento-ip-geolocation-lookup\/v1\/devguide\/rest-api#webpage","url":"https:\/\/plumrocket.com\/docs\/magento-ip-geolocation-lookup\/v1\/devguide\/rest-api","name":"Magento 2 IP Geolocation Lookup v1.x REST API Reference - Plumrocket Documentation","isPartOf":{"@id":"https:\/\/plumrocket.com\/docs\/#website"},"datePublished":"2021-04-28T09:22:51+00:00","dateModified":"2026-03-12T07:37:16+00:00","author":{"@id":"https:\/\/plumrocket.com\/docs\/#\/schema\/person\/c96fccdb89342ae6804272265723eca8"},"description":"GeoIP Lookup REST API allows you to integrate your own development with the IP Geolocation Lookup module using the REST API. To access the REST API, you","breadcrumb":{"@id":"https:\/\/plumrocket.com\/docs\/magento-ip-geolocation-lookup\/v1\/devguide\/rest-api#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/plumrocket.com\/docs\/magento-ip-geolocation-lookup\/v1\/devguide\/rest-api"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/plumrocket.com\/docs\/magento-ip-geolocation-lookup\/v1\/devguide\/rest-api#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Magento 2 Extensions","item":"https:\/\/plumrocket.com\/magento-extensions"},{"@type":"ListItem","position":2,"name":"Magento 2 IP Geolocation Lookup","item":"https:\/\/plumrocket.com\/magento-ip-geolocation-lookup"},{"@type":"ListItem","position":3,"name":"Documentation","item":"https:\/\/plumrocket.com\/docs\/magento-ip-geolocation-lookup"},{"@type":"ListItem","position":4,"name":"v1","item":"https:\/\/plumrocket.com\/docs\/magento-ip-geolocation-lookup\/v1"},{"@type":"ListItem","position":5,"name":"Developer Guide","item":"https:\/\/plumrocket.com\/docs\/magento-ip-geolocation-lookup\/v1\/devguide"},{"@type":"ListItem","position":6,"name":"REST API Reference"}]},{"@type":"Person","@id":"https:\/\/plumrocket.com\/docs\/#\/schema\/person\/c96fccdb89342ae6804272265723eca8","name":"Plumrocket","image":{"@type":"ImageObject","@id":"https:\/\/plumrocket.com\/docs\/#personlogo","inLanguage":"en-US","url":"https:\/\/secure.gravatar.com\/avatar\/10c44aa45aab391250913d982e552e53?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/10c44aa45aab391250913d982e552e53?s=96&d=mm&r=g","caption":"Plumrocket"}}]}},"_links":{"self":[{"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/posts\/18376"}],"collection":[{"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/comments?post=18376"}],"version-history":[{"count":5,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/posts\/18376\/revisions"}],"predecessor-version":[{"id":28958,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/posts\/18376\/revisions\/28958"}],"wp:attachment":[{"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/media?parent=18376"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/categories?post=18376"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/plumrocket.com\/docs\/wp-json\/wp\/v2\/tags?post=18376"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}