{"id":18247023,"url":"https://github.com/osspkg/go-smartcat-client","last_synced_at":"2026-01-12T01:56:55.330Z","repository":{"id":54890527,"uuid":"316034899","full_name":"osspkg/go-smartcat-client","owner":"osspkg","description":"Unofficial golang client for smartcat.com","archived":false,"fork":false,"pushed_at":"2021-01-22T00:15:09.000Z","size":53,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-02T20:06:20.249Z","etag":null,"topics":["go","golang","http-client","smartcat"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/osspkg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-25T19:26:54.000Z","updated_at":"2023-05-31T11:10:16.000Z","dependencies_parsed_at":"2022-08-14T05:50:49.109Z","dependency_job_id":null,"html_url":"https://github.com/osspkg/go-smartcat-client","commit_stats":null,"previous_names":["markus621/go-smartcat-client"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/osspkg/go-smartcat-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osspkg%2Fgo-smartcat-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osspkg%2Fgo-smartcat-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osspkg%2Fgo-smartcat-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osspkg%2Fgo-smartcat-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/osspkg","download_url":"https://codeload.github.com/osspkg/go-smartcat-client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/osspkg%2Fgo-smartcat-client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28331375,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:36:25.062Z","status":"ssl_error","status_checked_at":"2026-01-12T00:36:15.229Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["go","golang","http-client","smartcat"],"created_at":"2024-11-05T09:28:38.650Z","updated_at":"2026-01-12T01:56:55.314Z","avatar_url":"https://github.com/osspkg.png","language":"Go","readme":"# go-smartcat-client\nUnofficial golang client for smartcat.com\n\n[![Coverage Status](https://coveralls.io/repos/github/markus621/go-smartcat-client/badge.svg?branch=master)](https://coveralls.io/github/markus621/go-smartcat-client?branch=master)\n[![Release](https://img.shields.io/github/release/markus621/go-smartcat-client.svg?style=flat-square)](https://github.com/markus621/go-smartcat-client/releases/latest)\n[![Go Report Card](https://goreportcard.com/badge/github.com/markus621/go-smartcat-client)](https://goreportcard.com/report/github.com/markus621/go-smartcat-client)\n[![Build Status](https://travis-ci.com/markus621/go-smartcat-client.svg?branch=master)](https://travis-ci.com/markus621/go-smartcat-client)\n\n## Official documentation\n\n[Swagger 2.0](https://smartcat.com/api/swagger/docs/v1) + [Swagger UI](https://smartcat.com/api/methods/)\n\n# Example\n\n### _Create project and upload documents_\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\tcli \"github.com/markus621/go-smartcat-client\"\n)\n\n//nolint: errcheck\nfunc main() {\n\n\tconf := cli.Config{\n\t\tAccountID: os.Getenv(`SMARTCAT_ACCOUNT_ID`),\n\t\tAuthKey:   os.Getenv(`SMARTCAT_AUTH_KEY`),\n\t\tURL:       cli.HostURL,\n\t}\n\n\tclient := cli.NewClient(conf)\n\tclient.Debug(true, os.Stdout)\n\n\tproject, err := client.CreateProject(cli.NewProject{\n\t\tName:                     \"TS-10\",\n\t\tDescription:              \"Перевод с русского на английский\",\n\t\tSourceLanguage:           \"en-US\",\n\t\tTargetLanguages:          []string{\"ru\", \"id\"},\n\t\tAssignToVendor:           false,\n\t\tUseMT:                    false,\n\t\tPretranslate:             false,\n\t\tUseTranslationMemory:     false,\n\t\tAutoPropagateRepetitions: false,\n\t\tWorkflowStages:           []string{\"translation\"},\n\t\tIsForTesting:             false,\n\t})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tform := cli.NewForm()\n\tform.AddFile(\"base1.json\", []byte(`{\"main\":\"hello world\"}`))\n\tform.AddFile(\"base2.json\", []byte(`{\"main2\":\"hello my world\"}`))\n\n\tdocs, err := client.CreateDocument(project.ID, form)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(\"Create new docs\")\n\tfor _, doc := range docs {\n\t\tfmt.Println(doc.Status, doc.Name)\n\t\tfor _, ws := range doc.WorkflowStages {\n\t\t\tfmt.Println(ws.Status, ws.Progress)\n\t\t}\n\t}\n\n\tfmt.Println(\"Get status all docs\")\n\tproject, err = client.GetProject(project.ID)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfor _, doc := range project.Documents {\n\t\tfmt.Println(doc.Status, doc.Name)\n\t\tfor _, ws := range doc.WorkflowStages {\n\t\t\tfmt.Println(ws.Status, ws.Progress)\n\t\t}\n\t}\n\n}\n\n```\n\n### _Get all documents and export_\n```go\nimport (\n\t\"archive/zip\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"time\"\n\n\tcli \"github.com/markus621/go-smartcat-client\"\n)\n\n//nolint: errcheck\nfunc main() {\n\n\tconf := cli.Config{\n\t\tAccountID: os.Getenv(`SMARTCAT_ACCOUNT_ID`),\n\t\tAuthKey:   os.Getenv(`SMARTCAT_AUTH_KEY`),\n\t\tURL:       cli.HostURL,\n\t}\n\n\tclient := cli.NewClient(conf)\n\tclient.Debug(true, os.Stdout)\n\n\tlist, err := client.ListProject()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tids := make([]string, 0)\n\tfor _, project := range list {\n\t\tfmt.Println(project.ID, project.Name, project.Status)\n\t\tfor _, doc := range project.Documents {\n\t\t\tfmt.Println(doc.ID, doc.Name, doc.Status, doc.SourceLanguage, doc.TargetLanguage, doc.WorkflowStages[0].Progress)\n\n\t\t\tif doc.WorkflowStages[0].Progress == 100 {\n\t\t\t\tids = append(ids, doc.ID)\n\t\t\t}\n\t\t}\n\t}\n\n\ttask, err := client.ExportDocument(ids)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t\u003c-time.After(3 * time.Second)\n\n\tdata, err := client.ExportDocumentByTaskID(task.ID)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// as text file if one document\n\tif len(ids) == 1 {\n\t\tfmt.Println(string(data))\n\t\tos.Exit(0)\n\t}\n\n\t// as zip file if many documents\n\tz, err := zip.NewReader(bytes.NewReader(data), int64(len(data)))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfor _, f := range z.File {\n\t\treader, err := f.Open()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tb, err := ioutil.ReadAll(reader)\n\t\tfmt.Println(f.Name, string(b), err)\n\t}\n}\n\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosspkg%2Fgo-smartcat-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fosspkg%2Fgo-smartcat-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosspkg%2Fgo-smartcat-client/lists"}