PHPackages                             hejunjie/ip138 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. hejunjie/ip138

ActiveLibrary

hejunjie/ip138
==============

PHP 封装的 IP138 API SDK, 简化 IP、手机号归属地、天气查询信息接口以及二维码生成接口调用 | PHP SDK for IP138 API integration: IP lookup, mobile attribution, weather, QR code and more.

v1.0.0(11mo ago)115MITPHPPHP &gt;=8.1

Since Jun 16Pushed 6mo agoCompare

[ Source](https://github.com/zxc7563598/php-ip138)[ Packagist](https://packagist.org/packages/hejunjie/ip138)[ RSS](/packages/hejunjie-ip138/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

hejunjie/ip138
==============

[](#hejunjieip138)

 [English](./README.md)｜[简体中文](./README.zh-CN.md)---

While working on multiple projects, I often needed to use [IP138's](https://user.ip138.com) APIs — such as IP lookup, mobile attribution, weather queries, QR code generation, and more. However, since there's no official SDK, I had to write the HTTP requests, handle parameters, and process responses manually every time. It became repetitive and a bit tedious after a while.

So I decided to wrap all of IP138's available APIs into this PHP SDK. It makes integration much easier in my own projects, and I’m sharing it here in case it helps others who have similar needs.

**This project has been parsed by Zread. If you need a quick overview of the project, you can click here to view it：[Understand this project](https://zread.ai/zxc7563598/php-ip138)**

---

📦 Installation
--------------

[](#-installation)

Install this package via Composer：

```
composer require hejunjie/ip138
```

---

🚀 Usage
-------

[](#-usage)

Since each IP138 API endpoint uses a different token, tokens need to be configured separately for each interface. Two configuration options are provided.

1. **Global configuration**, suitable for more complex scenarios or when multiple API endpoints need to be called.

    ```
