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)
To install the library, use the following command:
go get github.com/go-api-libs/freepublicapis/pkg/freepublicapis
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
}
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
}
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 array
}
- Go Reference: The Go reference documentation for the client package.
- Official Documentation: The official API documentation.
- OpenAPI Specification: The OpenAPI 3.1.0 specification.
- Go Report Card: Check the code quality report.
If you have any contributions to make, please submit a pull request or open an issue on the GitHub repository.
This project is licensed under the MIT License. See the LICENSE file for details.