{"id":49488390,"url":"https://github.com/openapi/openapi-go-sdk","last_synced_at":"2026-05-01T03:03:42.275Z","repository":{"id":345308589,"uuid":"627961485","full_name":"openapi/openapi-go-sdk","owner":"openapi","description":"🐹 A fully-featured and blazing-fast Go API client to interact with Openapi®","archived":false,"fork":false,"pushed_at":"2026-03-18T14:26:40.000Z","size":107,"stargazers_count":1,"open_issues_count":11,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-28T03:43:53.461Z","etag":null,"topics":["api-client","api-marketplace","certified-api","cobra-cli","echo-framework","gin-gonic","go","golang","golang-library","http","openapi","rest-api"],"latest_commit_sha":null,"homepage":"https://console.openapi.com","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openapi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/contributing.md","funding":null,"license":"LICENSE","code_of_conduct":"docs/code-of-conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-04-14T15:27:12.000Z","updated_at":"2026-03-18T15:00:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"1ea7596f-51e6-4620-86f6-342f4f9803b4","html_url":"https://github.com/openapi/openapi-go-sdk","commit_stats":null,"previous_names":["openapi/openapi-go-sdk"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/openapi/openapi-go-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openapi%2Fopenapi-go-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openapi%2Fopenapi-go-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openapi%2Fopenapi-go-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openapi%2Fopenapi-go-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openapi","download_url":"https://codeload.github.com/openapi/openapi-go-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openapi%2Fopenapi-go-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32483405,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-client","api-marketplace","certified-api","cobra-cli","echo-framework","gin-gonic","go","golang","golang-library","http","openapi","rest-api"],"created_at":"2026-05-01T03:03:37.881Z","updated_at":"2026-05-01T03:03:42.259Z","avatar_url":"https://github.com/openapi.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://openapi.com/\"\u003e\n    \u003cimg alt=\"Openapi SDK for Go\" src=\".github/assets/repo-header-a3.png\" \u003e\n  \u003c/a\u003e\n\n  \u003ch1\u003eOpenapi® client for Go\u003c/h1\u003e\n  \u003ch4\u003eThe perfect starting point to integrate \u003ca href=\"https://openapi.com/\"\u003eOpenapi®\u003c/a\u003e within your Go project\u003c/h4\u003e\n\n[![Build Status](https://github.com/openapi/openapi-go-sdk/actions/workflows/go.yml/badge.svg)](https://github.com/openapi/openapi-go-sdk/actions/workflows/go.yml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/openapi/openapi-go-sdk)](https://goreportcard.com/report/github.com/openapi/openapi-go-sdk)\n[![Go Reference](https://pkg.go.dev/badge/github.com/openapi/openapi-go-sdk.svg)](https://pkg.go.dev/github.com/openapi/openapi-go-sdk)\n[![License](https://img.shields.io/github/license/openapi/openapi-go-sdk)](LICENSE)\n\u003cbr\u003e\n[![Linux Foundation Member](https://img.shields.io/badge/Linux%20Foundation-Silver%20Member-003778?logo=linux-foundation\u0026logoColor=white)](https://www.linuxfoundation.org/about/members)\n\u003c/div\u003e\n\n## Overview\n\nA minimal and agnostic Go SDK for Openapi, providing only the core HTTP primitives needed to interact with any Openapi service.\n\n## Pre-requisites\n\nBefore using the Openapi Go Client, you will need an account at [Openapi](https://console.openapi.com/) and an API key to the sandbox and/or production environment.\n\n## Features\n\n- **Agnostic Design**: No API-specific classes, works with any Openapi service\n- **Minimal Dependencies**: Only requires Go 1.19+\n- **OAuth Support**: Built-in OAuth client for token management\n- **HTTP Primitives**: GET, POST, PUT, DELETE and other HTTP methods\n- **Clean Interface**: Simple and idiomatic Go API\n\n## What you can do\n\nWith the Openapi Go Client, you can easily interact with a variety of services in the Openapi Marketplace. For example, you can:\n\n- 📩 **Send SMS messages** with delivery reports and custom sender IDs\n- 💸 **Process bills and payments** in real time via API\n- 🧾 **Send electronic invoices** securely to the Italian Revenue Agency\n- 📄 **Generate PDFs** from HTML content, including JavaScript rendering\n- ✉️ **Manage certified emails** and legal communications via Italian Legalmail\n\nFor a complete list of all available services, check out the [Openapi Marketplace](https://console.openapi.com/) 🌐\n\n## Installation\n\nAdd the SDK to your project:\n\n```bash\ngo get github.com/openapi/openapi-go-sdk\n```\n\nThen import the client package:\n\n```go\nimport \"github.com/openapi/openapi-go-sdk/pkg/client\"\n```\n\n## Usage\n\n### Token generation\n\nUse `OauthClient` to authenticate with your credentials and generate a scoped access token.\nThe `test` flag switches between the sandbox (`true`) and production (`false`) OAuth endpoint.\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/openapi/openapi-go-sdk/pkg/client\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\n\toauthClient := client.NewOauthClient(\"\u003cyour_username\u003e\", \"\u003cyour_apikey\u003e\", true)\n\n\tscopes := []string{\n\t\t\"GET:test.imprese.openapi.it/advance\",\n\t\t\"POST:test.postontarget.com/fields/country\",\n\t}\n\tresp, err := oauthClient.CreateToken(ctx, scopes, 3600)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\ttokenResponse := struct {\n\t\tScopes []string `json:\"scopes\"`\n\t\tToken  string   `json:\"token\"`\n\t}{}\n\tif err := json.Unmarshal([]byte(resp), \u0026tokenResponse); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tfmt.Printf(\"token: %s\\n\", tokenResponse.Token)\n}\n```\n\n### Making API calls\n\nUse `Client` with the token obtained above to call any Openapi service.\nPass the base URL and endpoint separately so the client can correctly attach query parameters.\n\n```go\npackage main\n\nimport (\n\t\"bytes\"\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/openapi/openapi-go-sdk/pkg/client\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\tapiClient := client.NewClient(\"\u003cyour_access_token\u003e\")\n\n\t// GET with query parameters\n\tparams := map[string]string{\n\t\t\"denominazione\": \"altravia\",\n\t\t\"provincia\":     \"RM\",\n\t\t\"codice_ateco\":  \"6201\",\n\t}\n\tresult, err := apiClient.Request(ctx, \"GET\", \"https://test.imprese.openapi.it\", \"/advance\", nil, params)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Println(result)\n\n\t// POST with a JSON payload\n\tpayload := struct {\n\t\tLimit int `json:\"limit\"`\n\t\tQuery struct {\n\t\t\tCountryCode string `json:\"country_code\"`\n\t\t} `json:\"query\"`\n\t}{\n\t\tLimit: 10,\n\t\tQuery: struct {\n\t\t\tCountryCode string `json:\"country_code\"`\n\t\t}{CountryCode: \"IT\"},\n\t}\n\tvar buf bytes.Buffer\n\tif err := json.NewEncoder(\u0026buf).Encode(payload); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tresult, err = apiClient.Request(ctx, \"POST\", \"https://test.postontarget.com\", \"/fields/country\", \u0026buf, nil)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Println(result)\n}\n```\n\nMore complete examples are available in the [`examples/`](examples/) directory.\n\n## Testing\n\nThe SDK ships with a suite of unit tests that use `net/http/httptest` — no real network calls, no credentials needed.\n\nRun the full suite:\n\n```bash\ngo test ./...\n```\n\nRun with verbose output to see each test case:\n\n```bash\ngo test -v ./pkg/client/...\n```\n\nRun a single test by name:\n\n```bash\ngo test -v -run TestCreateToken ./pkg/client/...\n```\n\n## Contributing\n\nContributions are always welcome! Whether you want to report bugs, suggest new features, improve documentation, or contribute code, your help is appreciated.\n\nSee [docs/contributing.md](docs/contributing.md) for detailed instructions on how to get started. Please make sure to follow this project's [docs/code-of-conduct.md](docs/code-of-conduct.md) to help maintain a welcoming and collaborative environment.\n\n## Authors\n\nMeet the project authors:\n\n- Michael Cuffaro ([@maiku1008](https://www.github.com/maiku1008))\n- Openapi Team ([@openapi-it](https://github.com/openapi-it))\n\n## Partners\n\nMeet our partners using Openapi or contributing to this SDK:\n\n- [Blank](https://www.blank.app/)\n- [Credit Safe](https://www.creditsafe.com/)\n- [Deliveroo](https://deliveroo.it/)\n- [Gruppo MOL](https://molgroupitaly.it/it/)\n- [Jakala](https://www.jakala.com/)\n- [Octotelematics](https://www.octotelematics.com/)\n- [OTOQI](https://otoqi.com/)\n- [PWC](https://www.pwc.com/)\n- [QOMODO S.R.L.](https://www.qomodo.me/)\n- [SOUNDREEF S.P.A.](https://www.soundreef.com/)\n\n## Our Commitments\n\nWe believe in open source and we act on that belief. We became Silver Members\nof the Linux Foundation because we wanted to formally support the ecosystem\nwe build on every day. Open standards, open collaboration, and open governance\nare part of how we work and how we think about software.\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n\nThe MIT License is a permissive open-source license that allows you to freely use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, provided that the original copyright notice and this permission notice are included in all copies or substantial portions of the software.\n\nIn short, you are free to use this SDK in your personal, academic, or commercial projects, with minimal restrictions. The project is provided \"as-is\", without any warranty of any kind, either expressed or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and non-infringement.\n\nFor more details, see the full license text at the [MIT License page](https://choosealicense.com/licenses/mit/).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenapi%2Fopenapi-go-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenapi%2Fopenapi-go-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenapi%2Fopenapi-go-sdk/lists"}