https://github.com/go-api-libs/freepublicapis
Go library for the Free Public APIs API. The Free Public APIs API provides up-to-date information on every free public API listed on freepublicapis.com. Perfect for developers, students and hobbyists. It is limited to 1000 requests a day, if you need more, feel free to reach out.
https://github.com/go-api-libs/freepublicapis
api api-client api-library freepublicapis freepublicapis-api go golang integration openapi openapi3
Last synced: 11 months ago
JSON representation
Go library for the Free Public APIs API. The Free Public APIs API provides up-to-date information on every free public API listed on freepublicapis.com. Perfect for developers, students and hobbyists. It is limited to 1000 requests a day, if you need more, feel free to reach out.
- Host: GitHub
- URL: https://github.com/go-api-libs/freepublicapis
- Owner: go-api-libs
- License: mit
- Created: 2024-11-16T00:52:30.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-22T12:12:49.000Z (about 1 year ago)
- Last Synced: 2025-01-14T02:35:59.743Z (about 1 year ago)
- Topics: api, api-client, api-library, freepublicapis, freepublicapis-api, go, golang, integration, openapi, openapi3
- Size: 734 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🤯 Free Public APIs API
[](https://pkg.go.dev/github.com/go-api-libs/freepublicapis/pkg/freepublicapis)
[](https://www.freepublicapis.com/api)
[](/api/openapi.json)
[](https://goreportcard.com/report/github.com/go-api-libs/freepublicapis)


[](./LICENSE)
FreePublicAPIs now has a free public API! The Free Public APIs API provides up-to-date information on every free public API listed on freepublicapis.com. Perfect for developers, students and hobbyists. It is limited to 1000 requests a day, if you need more, feel free to reach out. Also if you build something with this API, make sure to add it as a showcase project here. ([Source](https://freepublicapis.com/api))
## Installation
To install the library, use the following command:
```shell
go get github.com/go-api-libs/freepublicapis/pkg/freepublicapis
```
## Usage
### Example 1: Get a Random API
```go
package main
import (
"context"
"github.com/go-api-libs/freepublicapis/pkg/freepublicapis"
)
func main() {
c, err := freepublicapis.NewClient()
if err != nil {
panic(err)
}
ctx := context.Background()
simpleAPIInfo, err := c.GetRandom(ctx)
if err != nil {
panic(err)
}
// Use simpleAPIInfo object
}
```
### Example 2: Get a Specific API by ID
```go
package main
import (
"context"
"github.com/go-api-libs/freepublicapis/pkg/freepublicapis"
)
func main() {
c, err := freepublicapis.NewClient()
if err != nil {
panic(err)
}
ctx := context.Background()
simpleAPIInfo, err := c.GetAPI(ctx, 275)
if err != nil {
panic(err)
}
// Use simpleAPIInfo object
}
```
### Example 3: List APIs with Parameters
```go
package main
import (
"context"
"github.com/go-api-libs/freepublicapis/pkg/freepublicapis"
)
func main() {
c, err := freepublicapis.NewClient()
if err != nil {
panic(err)
}
ctx := context.Background()
apiInfos, err := c.ListApis(ctx, &freepublicapis.ListApisParams{
Limit: 10,
Sort: "best",
})
if err != nil {
panic(err)
}
// Use apiInfos slice
}
```
## Additional Information
- [**Go Reference**](https://pkg.go.dev/github.com/go-api-libs/freepublicapis/pkg/freepublicapis): The Go reference documentation for the client package.
- [**Official Documentation**](https://www.freepublicapis.com/api): 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/freepublicapis): 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/freepublicapis).
## License
This project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for details.