{"id":22632458,"url":"https://github.com/uploadcare/uploadcare-go","last_synced_at":"2025-04-11T20:11:02.994Z","repository":{"id":45630097,"uuid":"210614430","full_name":"uploadcare/uploadcare-go","owner":"uploadcare","description":"Golang API client that handles uploads and further operations with files by wrapping Uploadcare Upload and REST APIs.","archived":false,"fork":false,"pushed_at":"2023-07-10T08:52:04.000Z","size":183,"stargazers_count":16,"open_issues_count":2,"forks_count":6,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-21T23:35:14.590Z","etag":null,"topics":["api","client","file-upload","image-processing","image-recognition","image-upload","processing","sdk","upload","uploadcare","uploader"],"latest_commit_sha":null,"homepage":"https://uploadcare.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/uploadcare.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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}},"created_at":"2019-09-24T13:48:59.000Z","updated_at":"2024-11-12T02:46:43.000Z","dependencies_parsed_at":"2024-06-20T00:08:56.282Z","dependency_job_id":"1d9ad4ce-93d1-4384-b597-89ed385124ff","html_url":"https://github.com/uploadcare/uploadcare-go","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uploadcare%2Fuploadcare-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uploadcare%2Fuploadcare-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uploadcare%2Fuploadcare-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uploadcare%2Fuploadcare-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uploadcare","download_url":"https://codeload.github.com/uploadcare/uploadcare-go/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248473127,"owners_count":21109628,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","file-upload","image-processing","image-recognition","image-upload","processing","sdk","upload","uploadcare","uploader"],"created_at":"2024-12-09T02:17:39.303Z","updated_at":"2025-04-11T20:11:02.964Z","avatar_url":"https://github.com/uploadcare.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Golang API client for Uploadcare\n\n![license](https://img.shields.io/badge/license-MIT-brightgreen.svg)\n[![GoDoc](http://img.shields.io/badge/godoc-reference-blue.svg)](http://godoc.org/github.com/uploadcare/uploadcare-go/ucare)\n![](https://github.com/uploadcare/uploadcare-go/workflows/test/badge.svg)\n\nUploadcare Golang API client that handles uploads and further operations with files by wrapping Uploadcare Upload and REST APIs.\n\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [Configuration](#configuration)\n- [Usage](#usage)\n- [Useful links](#useful-links)\n\n## Requirements\n\ngo1.13\n\n## Installation\n\nInstall uploadcare-go with:\n\n```\ngo get -u -v github.com/uploadcare/uploadcare-go/...\n```\n\nThen import it using:\n\n```go\nimport (\n\t\"github.com/uploadcare/uploadcare-go/ucare\"\n\t\"github.com/uploadcare/uploadcare-go/file\"\n\t\"github.com/uploadcare/uploadcare-go/group\"\n\t\"github.com/uploadcare/uploadcare-go/upload\"\n\t\"github.com/uploadcare/uploadcare-go/conversion\"\n)\n```\n\n## Configuration\n\nCreating a client:\n\n```go\ncreds := ucare.APICreds{\n\tSecretKey: \"your-project-secret-key\",\n\tPublicKey: \"your-project-public-key\",\n}\n\nconf := \u0026ucare.Config{\n\tSignBasedAuthentication: true,\n\tAPIVersion:              ucare.APIv06,\n}\n\nclient, err := ucare.NewClient(creds, conf)\nif err != nil {\n\tlog.Fatal(\"creating uploadcare API client: %s\", err)\n}\n```\n\n## Usage\n\nFor a comprehensive list of examples, check out the [API documentation](https://godoc.org/github.com/uploadcare/uploadcare-go/ucare).\nBelow are a few usage examples:\n\nGetting a list of files:\n\n```go\nfileSvc := file.NewService(client)\n\nlistParams := file.ListParams{\n\tStored:  ucare.Bool(true),\n\tOrderBy: ucare.String(file.OrderBySizeAsc),\n}\n\nfileList, err := fileSvc.List(context.Background(), listParams)\nif err != nil {\n\t// handle error\n}\n\n// getting IDs of the files\nids := make([]string, 0, 100)\nfor fileList.Next() {\n\tfinfo, err :=  fileList.ReadResult()\n\tif err != nil {\n\t\t// handle error\n\t}\n\n\tids = append(ids, finfo.ID)\n}\n```\n\nAcquiring file-specific info:\n\n```go\nfileID := ids[0]\nfile, err := fileSvc.Info(context.Background(), fileID)\nif err != nil {\n\t// handle error\n}\n\nif file.IsImage {\n\th := file.ImageInfo.Height\n\tw := file.ImageInfo.Width\n\tfmt.Printf(\"image size: %dx%d\\n\", h, w)\n}\n```\n\nUploading a file:\n\n```go\nf, err := os.Open(\"file.png\")\nif err != nil {\n\t// handle error\n}\n\nuploadSvc := upload.NewService(client)\n\nparams := upload.FileParams{\n\tData:        f,\n\tName:        f.Name(),\n\tContentType: \"image/png\",\n}\nfID, err := uploadSvc.File(context.Background(), params)\nif err != nil {\n\t// handle error\n}\n```\n\n## Useful links\n\n[Golang API client documentation](https://godoc.org/github.com/uploadcare/uploadcare-go/ucare)  \n[Uploadcare documentation](https://uploadcare.com/docs/?utm_source=github\u0026utm_medium=referral\u0026utm_campaign=uploadcare-go)  \n[Upload API reference](https://uploadcare.com/api-refs/upload-api/?utm_source=github\u0026utm_medium=referral\u0026utm_campaign=uploadcare-go)  \n[REST API reference](https://uploadcare.com/api-refs/rest-api/?utm_source=github\u0026utm_medium=referral\u0026utm_campaign=uploadcare-go)  \n[Changelog](https://github.com/uploadcare/uploadcare-go/blob/master/CHANGELOG.md)  \n[Contributing guide](https://github.com/uploadcare/.github/blob/master/CONTRIBUTING.md)  \n[Security policy](https://github.com/uploadcare/uploadcare-go/security/policy)  \n[Support](https://github.com/uploadcare/.github/blob/master/SUPPORT.md)  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuploadcare%2Fuploadcare-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuploadcare%2Fuploadcare-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuploadcare%2Fuploadcare-go/lists"}