Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: about 1 month 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 (about 2 months ago)
- Default Branch: main
- Last Pushed: 2024-12-22T14:14:40.000Z (about 2 months ago)
- Last Synced: 2024-12-31T07:46:13.632Z (about 1 month ago)
- Topics: api, api-client, api-library, go, golang, integration, ip, ipify, ipify-api, ipv4, ipv6, openapi, openapi3
- Language: Go
- Homepage:
- Size: 496 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
[![Go Reference](https://pkg.go.dev/badge/github.com/go-api-libs/ipify.svg)](https://pkg.go.dev/github.com/go-api-libs/ipify/pkg/ipify)
[![Official Documentation](https://img.shields.io/badge/docs-API-blue)](https://www.ipify.org/)
[![OpenAPI](https://img.shields.io/badge/OpenAPI-3.1-blue)](/api/openapi.json)
[![Go Report Card](https://goreportcard.com/badge/github.com/go-api-libs/ipify)](https://goreportcard.com/report/github.com/go-api-libs/ipify)
![Code Coverage](https://img.shields.io/badge/coverage-51%25-yellow)
![API Health](https://img.shields.io/badge/API_health-95%25-brightgreen)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./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.