{"id":41464121,"url":"https://github.com/coinbase-samples/advanced-trade-sdk-go","last_synced_at":"2026-01-23T16:18:01.117Z","repository":{"id":239242914,"uuid":"794716195","full_name":"coinbase-samples/advanced-trade-sdk-go","owner":"coinbase-samples","description":"Sample Go SDK for the Coinbase Advanced Trade REST APIs","archived":false,"fork":false,"pushed_at":"2025-05-05T22:19:21.000Z","size":70,"stargazers_count":30,"open_issues_count":8,"forks_count":16,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-09-20T11:02:07.343Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://docs.cdp.coinbase.com/advanced-trade/docs/welcome","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coinbase-samples.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-05-01T19:57:17.000Z","updated_at":"2025-08-25T17:19:24.000Z","dependencies_parsed_at":"2024-05-10T23:32:59.801Z","dependency_job_id":"d98fcc9a-5005-4b26-aacf-8f57cd61fcca","html_url":"https://github.com/coinbase-samples/advanced-trade-sdk-go","commit_stats":null,"previous_names":["coinbase-samples/advanced-trade-sdk-go"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/coinbase-samples/advanced-trade-sdk-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coinbase-samples%2Fadvanced-trade-sdk-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coinbase-samples%2Fadvanced-trade-sdk-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coinbase-samples%2Fadvanced-trade-sdk-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coinbase-samples%2Fadvanced-trade-sdk-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coinbase-samples","download_url":"https://codeload.github.com/coinbase-samples/advanced-trade-sdk-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coinbase-samples%2Fadvanced-trade-sdk-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28695529,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T15:57:05.722Z","status":"ssl_error","status_checked_at":"2026-01-23T15:56:27.656Z","response_time":59,"last_error":"SSL_read: 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":[],"created_at":"2026-01-23T16:17:59.315Z","updated_at":"2026-01-23T16:18:01.094Z","avatar_url":"https://github.com/coinbase-samples.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Advanced Trade Go SDK README\n\n[![GoDoc](https://godoc.org/github.com/coinbase-samples/advanced-trade-sdk-go?status.svg)](https://godoc.org/github.com/coinbase-samples/advanced-trade-sdk-go)\n[![Go Report Card](https://goreportcard.com/badge/coinbase-samples/advanced-trade-sdk-go)](https://goreportcard.com/report/coinbase-samples/advanced-trade-sdk-go)\n\n## Overview\n\nThe *Advanced Trade Go SDK* is a sample library that demonstrates the structure of a [Coinbase Advanced Trade](https://www.coinbase.com/advanced-trade/) driver for\nthe [REST APIs](https://docs.cloud.coinbase.com/advanced-trade/docs/welcome).\n\nCoinbase Advanced Trade offers a comprehensive API for traders, providing access to real-time market data, order management, and execution. Elevate your trading strategies and develop sophisticated solutions using our powerful tools and features.\n\n## License\n\nThe *Advanced Trade Go SDK* sample library is free and open source and released under the [Apache License, Version 2.0](LICENSE).\n\nThe application and code are only available for demonstration purposes.\n\n## Usage\n\nTo use the *Advanced Trade Go SDK*, initialize the [Credentials](credentials.go) struct and create a new client. The Credentials struct is JSON\nenabled. Ensure that Advanced Trade API credentials are stored in a secure manner.\n\n```\ncredentials := \u0026credentials.Credentials{}\nif err := json.Unmarshal([]byte(os.Getenv(\"ADVANCED_CREDENTIALS\")), credentials); err != nil {\n    log.Fatalf(\"unable to deserialize advanced trade credentials JSON: %v\", err)\n}\n\nhttpClient, err := client.DefaultHttpClient()\nif err != nil {\n    log.Fatalf(\"unable to load default http client: %v\", err)\n}\n\nrestClient := client.NewRestClient(credentials, httpClient)\n```\n\nThere are convenience functions to read the credentials as an environment variable (credentials.ReadEnvCredentials) and to deserialize the JSON structure (credentials.UnmarshalCredentials) if pulled from a different source. The JSON format expected by both is:\n\n```\n{\n  \"accessKey\": \"\",\n  \"privatePemKey\": \"\"\n}\n```\n\nCoinbase Advanced Trade API credentials can be created in the [CDP web portal](https://portal.cdp.coinbase.com/). \n\nOnce the client is initialized, initialize a service to make the desired call. For example, to [list portfolios](https://github.com/coinbase-samples/advanced-trade-sdk-go/blob/main/list_portfolios.go),\ncreate the service, pass in the request object, check for an error, and if nil, process the response.\n\n```\nportfoliosService := portfolios.NewPortfoliosService(restClient)\n\nresp, err := portfoliosService.ListPortfolios(context.Background(), \u0026portfolios.ListPortfoliosRequest{})\nif err != nil {\n    log.Fatalf(\"error listing portfolios: %v\", err)\n}\n\njsonResponse, err := json.MarshalIndent(resp, \"\", \"  \")\nif err != nil {\n    panic(fmt.Sprintf(\"error marshaling response to JSON: %v\", err))\n}\n\nfmt.Println(string(jsonResponse))\n```\n\n## Build\n\nTo build the sample library, ensure that [Go](https://go.dev/) 1.19+ is installed and then run:\n\n```bash\ngo build ./...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoinbase-samples%2Fadvanced-trade-sdk-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoinbase-samples%2Fadvanced-trade-sdk-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoinbase-samples%2Fadvanced-trade-sdk-go/lists"}