{"id":16668357,"url":"https://github.com/kielabokkie/ipdata-php","last_synced_at":"2025-04-09T19:32:27.266Z","repository":{"id":57006384,"uuid":"125434772","full_name":"kielabokkie/ipdata-php","owner":"kielabokkie","description":"Get IP address information using the ipdata.co API.","archived":false,"fork":false,"pushed_at":"2020-09-16T09:38:42.000Z","size":39,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T21:23:17.564Z","etag":null,"topics":["geolocation","geolocation-api","ipdata","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kielabokkie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-15T22:46:28.000Z","updated_at":"2023-03-10T12:00:16.000Z","dependencies_parsed_at":"2022-08-21T14:30:31.238Z","dependency_job_id":null,"html_url":"https://github.com/kielabokkie/ipdata-php","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kielabokkie%2Fipdata-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kielabokkie%2Fipdata-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kielabokkie%2Fipdata-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kielabokkie%2Fipdata-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kielabokkie","download_url":"https://codeload.github.com/kielabokkie/ipdata-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247744329,"owners_count":20988784,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["geolocation","geolocation-api","ipdata","php"],"created_at":"2024-10-12T11:24:43.773Z","updated_at":"2025-04-09T19:32:27.243Z","avatar_url":"https://github.com/kielabokkie.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ipdata client library for PHP\n\n[![Author](http://img.shields.io/badge/by-@kielabokkie-lightgrey.svg?style=flat-square)](https://twitter.com/kielabokkie)\n[![Packagist Version](https://img.shields.io/packagist/v/kielabokkie/ipdata.svg?style=flat-square)](https://packagist.org/packages/kielabokkie/ipdata)\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)\n\nGet IP address information the using the [ipdata.co](https://ipdata.co) API. If you are using Laravel, check out [kielabokkie/laravel-ipdata](https://github.com/kielabokkie/laravel-ipdata).\n\n## Prerequisites\n\nIpdata has a free plan that allows you to make 1,500 requests per day and paid plans if you need more than that. All plans need an API key and you'll have to register on their [website](https://ipdata.co/pricing.html) to get one.\n\n## Installation\n\nYou can install the package via composer:\n\n    composer require kielabokkie/ipdata\n\n## Usage\n\n### Lookup of the calling IP address\n\nPlease note that when you instantiate the Ipdata class you have to pass your API key as a parameter.\n\n```\n$ipdata = new \\Kielabokkie\\Ipdata('yourapikey');\n$res = $ipdata-\u003elookup();\n```\n\n### Lookup a specific IP address\n\n```\n$ipdata = new \\Kielabokkie\\Ipdata('yourapikey');\n$res = $ipdata-\u003elookup('1.1.1.1');\n```\n\nThe Ipdata API will return the following data:\n\n```json\n{\n  \"ip\": \"1.1.1.1\",\n  \"is_eu\": false,\n  \"city\": \"Research\",\n  \"region\": \"Victoria\",\n  \"region_code\": \"VIC\",\n  \"country_name\": \"Australia\",\n  \"country_code\": \"AU\",\n  \"continent_name\": \"Oceania\",\n  \"continent_code\": \"OC\",\n  \"latitude\": -37.7,\n  \"longitude\": 145.1833,\n  \"asn\": \"AS13335\",\n  \"organisation\": \"Cloudflare Inc\",\n  \"postal\": \"3095\",\n  \"calling_code\": \"61\",\n  \"flag\": \"https://ipdata.co/flags/au.png\",\n  \"emoji_flag\": \"🇦🇺\",\n  \"emoji_unicode\": \"U+1F1E6 U+1F1FA\",\n  \"languages\": [\n    {\n      \"name\": \"English\",\n      \"native\": \"English\"\n    }\n  ],\n  \"currency\": {\n    \"name\": \"Australian Dollar\",\n    \"code\": \"AUD\",\n    \"symbol\": \"AU$\",\n    \"native\": \"$\",\n    \"plural\": \"Australian dollars\"\n  },\n  \"time_zone\": {\n    \"name\": \"Australia/Melbourne\",\n    \"abbr\": \"AEST\",\n    \"offset\": \"+1000\",\n    \"is_dst\": false,\n    \"current_time\": \"2018-06-20T11:41:23.068040+10:00\"\n  },\n  \"threat\": {\n    \"is_tor\": false,\n    \"is_proxy\": false,\n    \"is_anonymous\": false,\n    \"is_known_attacker\": false,\n    \"is_known_abuser\": false,\n    \"is_threat\": false,\n    \"is_bogon\": false\n  }\n}\n```\n\nThis library will run the response through a json_decode giving you an easy object to work with, for example:\n\n```php\necho $res-\u003ecountry_name; // Australia\necho $res-\u003eflag; // https://ipdata.co/flags/au.png\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkielabokkie%2Fipdata-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkielabokkie%2Fipdata-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkielabokkie%2Fipdata-php/lists"}