{"id":808,"date":"2019-01-17T09:38:31","date_gmt":"2019-01-17T00:38:31","guid":{"rendered":"https:\/\/dong1lkim.oboki.net\/?p=808"},"modified":"2019-09-01T22:23:32","modified_gmt":"2019-09-01T13:23:32","slug":"ipstack-api-ip-%ec%9c%84%ec%b9%98-%ec%a0%95%eb%b3%b4-%ec%a1%b0%ed%9a%8c","status":"publish","type":"post","link":"https:\/\/oboki.net\/workspace\/python\/ipstack-api-ip-%ec%9c%84%ec%b9%98-%ec%a0%95%eb%b3%b4-%ec%a1%b0%ed%9a%8c\/","title":{"rendered":"[Python] ipstack API &#8211; IP \uc704\uce58 \uc815\ubcf4 \uc870\ud68c"},"content":{"rendered":"<h1>ipstack API &#8211; IP \uc704\uce58 \uc815\ubcf4 \uc870\ud68c<\/h1>\n<p><a href=\"https:\/\/ipstack.com\/\"><a href=\"https:\/\/ipstack.com\/\"><a href=\"https:\/\/ipstack.com\/\">https:\/\/ipstack.com\/<\/a><\/a><\/a> \uc5d0 \uc811\uc18d\ud558\uba74 ip \uc8fc\uc18c\ub85c \uc704\uce58 \uc815\ubcf4 \uac80\uc0c9\uc744 \ud574\ubcfc \uc218\uac00 \uc788\ub294\ub370 \uc774\uac78 API\ub85c \uc81c\uacf5\ud55c\ub2e4.<\/p>\n<p>\uc6d4 1\ub9cc\ud68c \uc870\ud68c\ub294 \ubb34\ub8cc\ub85c \uc0ac\uc6a9\ud560 \uc218 \uc788\uace0 \uadf8 \uc774\uc0c1\uc744 \uc6d0\ud558\uba74 \uc804\ubb38\uac00, \uae30\uc5c5\uc6a9 \ud50c\ub79c\uc744 \uc2e0\uccad\ud574\uc57c\ud55c\ub2e4.<\/p>\n<p><img decoding=\"async\" src=\"\/workspace\/wp-content\/uploads\/2019\/01\/ipstack_pricing.png\" alt=\"\" \/><\/p>\n<h2>API<\/h2>\n<p>API \uc0ac\uc6a9\ubc29\ubc95\uc740 <a href=\"https:\/\/ipstack.com\/documentation\"><a href=\"https:\/\/ipstack.com\/documentation\"><a href=\"https:\/\/ipstack.com\/documentation\">https:\/\/ipstack.com\/documentation<\/a><\/a><\/a> \ud398\uc774\uc9c0\uc5d0 \ub098\uc640\uc788\ub294\ub370 \uae30\ubcf8\uc801\uc778 \uc0ac\uc6a9\ubc95\uc740 \uc544\ub798\uc640 \uac19\ub2e4.<\/p>\n<h3>URL<\/h3>\n<pre><code class=\"url\">http:\/\/api.ipstack.com\/134.201.250.155?access_key=YOUR_ACCESS_KEY\n<\/code><\/pre>\n<h3>Response<\/h3>\n<pre><code class=\"json\">{\n  \"ip\": \"134.201.250.155\",\n  \"hostname\": \"134.201.250.155\",\n  \"type\": \"ipv4\",\n  \"continent_code\": \"NA\",\n  \"continent_name\": \"North America\",\n  \"country_code\": \"US\",\n  \"country_name\": \"United States\",\n  \"region_code\": \"CA\",\n  \"region_name\": \"California\",\n  \"city\": \"Los Angeles\",\n  \"zip\": \"90013\",\n  \"latitude\": 34.0453,\n  \"longitude\": -118.2413,\n  \"location\": {\n    \"geoname_id\": 5368361,\n    \"capital\": \"Washington D.C.\",\n    \"languages\": [\n        {\n          \"code\": \"en\",\n          \"name\": \"English\",\n          \"native\": \"English\"\n        }\n    ],\n    \"country_flag\": \"https:\/\/assets.ipstack.com\/images\/assets\/flags_svg\/us.svg\",\n    \"country_flag_emoji\": \"??\",\n    \"country_flag_emoji_unicode\": \"U+1F1FA U+1F1F8\",\n    \"calling_code\": \"1\",\n    \"is_eu\": false\n  },\n  \"time_zone\": {\n    \"id\": \"America\/Los_Angeles\",\n    \"current_time\": \"2018-03-29T07:35:08-07:00\",\n    \"gmt_offset\": -25200,\n    \"code\": \"PDT\",\n    \"is_daylight_saving\": true\n  },\n  \"currency\": {\n    \"code\": \"USD\",\n    \"name\": \"US Dollar\",\n    \"plural\": \"US dollars\",\n    \"symbol\": \"$\",\n    \"symbol_native\": \"$\"\n  },\n  \"connection\": {\n    \"asn\": 25876,\n    \"isp\": \"Los Angeles Department of Water &amp; Power\"\n  },\n  \"security\": {\n    \"is_proxy\": false,\n    \"proxy_type\": null,\n    \"is_crawler\": false,\n    \"crawler_name\": null,\n    \"crawler_type\": null,\n    \"is_tor\": false,\n    \"threat_level\": \"low\",\n    \"threat_types\": null\n  }\n}\n<\/code><\/pre>\n<h3>Python Sample<\/h3>\n<p>python <code>requests<\/code> \ub97c \uc774\uc6a9\ud558\uba74 \uac04\ub2e8\ud558\uac8c REST API \uc694\uccad\uc744 \ubcf4\ub0b4\uace0 \uc751\ub2f5\uc744 \ubc1b\uc744 \uc218 \uc788\ub2e4.<\/p>\n<pre><code class=\"py\">import requests\nimport json\n\ndef getLocationFromIP(ipaddr):\n    url = \"http:\/\/api.ipstack.com\/\"+ipaddr+\"?access_key=YOUR_ACCESS_KEY\"\n    result = json.loads(requests.get(url).text)\n    #print(result)\n    return result\n\nif __name__ == '__main__':\n    result = getLocationFromIP(\"134.201.250.155\")\n    print(result)\n<\/code><\/pre><\/p>\n","protected":false},"excerpt":{"rendered":"<p>ipstack API &#8211; IP \uc704\uce58 \uc815\ubcf4 \uc870\ud68c https:\/\/ipstack.com\/ \uc5d0 \uc811\uc18d\ud558\uba74 ip \uc8fc\uc18c\ub85c \uc704\uce58 \uc815\ubcf4 \uac80\uc0c9\uc744 \ud574\ubcfc \uc218\uac00 \uc788\ub294\ub370 \uc774\uac78 API\ub85c \uc81c\uacf5\ud55c\ub2e4. \uc6d4 1\ub9cc\ud68c \uc870\ud68c\ub294 \ubb34\ub8cc\ub85c \uc0ac\uc6a9\ud560 \uc218 \uc788\uace0 \uadf8 \uc774\uc0c1\uc744 \uc6d0\ud558\uba74 \uc804\ubb38\uac00, \uae30\uc5c5\uc6a9 \ud50c\ub79c\uc744 \uc2e0\uccad\ud574\uc57c\ud55c\ub2e4. API API \uc0ac\uc6a9\ubc29\ubc95\uc740 https:\/\/ipstack.com\/documentation \ud398\uc774\uc9c0\uc5d0 \ub098\uc640\uc788\ub294\ub370 \uae30\ubcf8\uc801\uc778 \uc0ac\uc6a9\ubc95\uc740 \uc544\ub798\uc640 \uac19\ub2e4. URL http:\/\/api.ipstack.com\/134.201.250.155?access_key=YOUR_ACCESS_KEY Response { &#8220;ip&#8221;: &#8220;134.201.250.155&#8221;, &#8220;hostname&#8221;: &#8220;134.201.250.155&#8221;, &#8220;type&#8221;: &#8220;ipv4&#8221;, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[113,68,114,34],"class_list":["post-808","post","type-post","status-publish","format-standard","hentry","category-python","tag-geo","tag-ipstack","tag-openapi","tag-python"],"_links":{"self":[{"href":"https:\/\/oboki.net\/workspace\/wp-json\/wp\/v2\/posts\/808","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oboki.net\/workspace\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/oboki.net\/workspace\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/oboki.net\/workspace\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oboki.net\/workspace\/wp-json\/wp\/v2\/comments?post=808"}],"version-history":[{"count":4,"href":"https:\/\/oboki.net\/workspace\/wp-json\/wp\/v2\/posts\/808\/revisions"}],"predecessor-version":[{"id":1362,"href":"https:\/\/oboki.net\/workspace\/wp-json\/wp\/v2\/posts\/808\/revisions\/1362"}],"wp:attachment":[{"href":"https:\/\/oboki.net\/workspace\/wp-json\/wp\/v2\/media?parent=808"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oboki.net\/workspace\/wp-json\/wp\/v2\/categories?post=808"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oboki.net\/workspace\/wp-json\/wp\/v2\/tags?post=808"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}