https://github.com/go-api-libs/ipify
Go library for the ipify API. A simple public IP address API, easy to integrate into any application in seconds.
https://github.com/go-api-libs/ipify
api api-client api-library go golang integration ip ipify ipify-api ipv4 ipv6 openapi openapi3
Last synced: 4 months ago
JSON representation
Go library for the ipify API. A simple public IP address API, easy to integrate into any application in seconds.
- Host: GitHub
- URL: https://github.com/go-api-libs/ipify
- Owner: go-api-libs
- License: mit
- Created: 2024-12-22T11:01:31.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-01-14T15:25:40.000Z (6 months ago)
- Last Synced: 2025-01-14T16:59:36.627Z (6 months ago)
- Topics: api, api-client, api-library, go, golang, integration, ip, ipify, ipify-api, ipv4, ipv6, openapi, openapi3
- Language: Go
- Homepage:
- Size: 497 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🌐 ipify API
[](https://pkg.go.dev/github.com/go-api-libs/ipify/pkg/ipify)
[](https://www.ipify.org/)
[](/api/openapi.json)
[](https://goreportcard.com/report/github.com/go-api-libs/ipify)


[](./LICENSE)A simple public IP address API, easy to integrate into any application in seconds. ([Source](https://freepublicapis.com/ipify-api))
## Installation
To install the library, use the following command:
```shell
go get github.com/go-api-libs/ipify/pkg/ipify
```## Usage
### Example: Get you public IP address
```go
package mainimport (
"context""github.com/go-api-libs/ipify/pkg/ipify"
)func main() {
c, err := ipify.NewClient()
if err != nil {
panic(err)
}ctx := context.Background()
ipWrapper, err := c.GetIP(ctx, &ipify.GetIPParams{Format: "json"})
if err != nil {
panic(err)
}// Use ipWrapper object
}```
## Additional Information
- [**Go Reference**](https://pkg.go.dev/github.com/go-api-libs/ipify/pkg/ipify): The Go reference documentation for the client package.
- [**Official Documentation**](https://www.ipify.org/): The official API documentation.
- [**OpenAPI Specification**](./api/openapi.json): The OpenAPI 3.1.0 specification.
- [**Go Report Card**](https://goreportcard.com/report/github.com/go-api-libs/ipify): Check the code quality report.## Contributing
If you have any contributions to make, please submit a pull request or open an issue on the [GitHub repository](https://github.com/go-api-libs/ipify).
## License
This project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for details.