{"id":28961406,"url":"https://github.com/iomonad/discogs","last_synced_at":"2025-06-24T02:03:05.671Z","repository":{"id":297945075,"uuid":"998373576","full_name":"iomonad/discogs","owner":"iomonad","description":"A fully-featured, data-oriented, Discogs Client written in pure clojure.","archived":false,"fork":false,"pushed_at":"2025-06-17T15:12:45.000Z","size":109,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-17T15:41:42.150Z","etag":null,"topics":["api-client","clojure","discogs"],"latest_commit_sha":null,"homepage":"https://cljdoc.org/d/io.trosa/discogs/CURRENT","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iomonad.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":"2025-06-08T13:28:45.000Z","updated_at":"2025-06-17T15:12:24.000Z","dependencies_parsed_at":"2025-06-08T14:40:37.126Z","dependency_job_id":null,"html_url":"https://github.com/iomonad/discogs","commit_stats":null,"previous_names":["iomonad/discogs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/iomonad/discogs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iomonad%2Fdiscogs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iomonad%2Fdiscogs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iomonad%2Fdiscogs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iomonad%2Fdiscogs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iomonad","download_url":"https://codeload.github.com/iomonad/discogs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iomonad%2Fdiscogs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261589907,"owners_count":23181434,"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","clojure","discogs"],"created_at":"2025-06-24T02:03:05.124Z","updated_at":"2025-06-24T02:03:05.662Z","avatar_url":"https://github.com/iomonad.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Discogs  [![Clojure CI](https://github.com/iomonad/discogs/actions/workflows/clojure.yml/badge.svg?branch=master)](https://github.com/iomonad/discogs/actions/workflows/clojure.yml) [![Clojars Project](https://img.shields.io/clojars/v/io.trosa/discogs.svg)](https://clojars.org/io.trosa/discogs) [![cljdoc badge](https://cljdoc.org/badge/io.trosa/discogs)](https://cljdoc.org/d/io.trosa/discogs) \u003ca href=\"https://github.com/iomonad/discogs\"\u003e\u003cimg src=\".github/banner.png\" height=\"280\" align=\"right\"\u003e\u003c/a\u003e\n\n\u003e [!NOTE]\n\u003e A fully-featured, data-oriented, [Discogs](https://discogs.com) API Client written in pure clojure.\n\n## Usage\n\n### Create a Client\n\nThere is differents way to create a Discogs client, here is a detailed guide to find what fit the best for your use-case:\n\n#### 1. Create anonymous client\n\u003e [!NOTE]\n\u003e Requests are throttled by the server by source IP to **60** per minute for authenticated requests, and **25 per minute** for unauthenticated requests, with some exceptions.\n\n```clojure\n(require '[discogs.client :as dc])\n\n(def client (dc/mk-client))\n```\n\n#### 2. Using Environnement Variable\n\nIn your execution context, set `DISCOGS_TOKEN` then use:\n\n\n```clojure\n(require '[discogs.client :as dc])\n\n(def client (dc/mk-client)) ;; =\u003e {:method :env-variable ...}\n```\n\n#### 3. Create client for application Key \u0026 Secrets\n\n- **Go to Discogs Developers Portal:**  \n  Visit [Discogs API Documentation](https://www.discogs.com/developers/) to create your developer account\n- **Create an App:**  \n  In your developer settings, create a new application. You will receive a **Consumer Key** and **Consumer Secret**.\n\n```clojure\n(require '[discogs.client :as dc])\n\n(def client (dc/mk-client \"ZrUgstGwOmYzWChuPXrH\" \"S3FEVERXljTmdQZ3ZoY0NocloK\"))\n```\n\n#### 4. Create Using PAT\n\nTo generate a Personal Access Token (PAT) for the Discogs API, follow these steps:\n\n1. **Log in to your Discogs Account:**  \n   Go to the Discogs website and sign in with your username and password.\n2. **Navigate to Developer Settings:**  \n   - Click your user avatar (usually in the top-right corner).\n   - Select **Settings** from the dropdown menu.\n   - Go to the **Developers** section.\n3. **Generate a New Token:**  \n   - In the Developers section, look for the option to **Generate new token**.\n   - Click it to create your personal access token.\n4. **Store the Token Securely:**  \n   - Copy the generated token and keep it safe—do not share it or commit it to public repositories.\n   - You can use it directly in your API requests as an authentication header.\n\n\u003e [!WARNING]\n\u003e This token is only valid for your own account and does not allow access to other users’ data unless you use OAuth for broader permissions.\n\n\n```clojure\n(require '[discogs.client :as dc])\n\n(def client (dc/mk-client \"pat_ZrUgstGNqDTDWMGWChuPXrH\"))\n```\n\n### Monitor Quota Usage\n\nYou can monitor API usage by adding client request callback as follow:\n\n```clojure\n(require '[discogs.reporter :as dr])\n\n(dr/set-quota-reporter-callback! client (fn [quota] (println \"Quota:\" quota)))\n\n;; Or use default one\n\n(dr/set-quota-reporter-callback! client dr/default-reporter)\n```\n\nDefault callback will monitor when quota is below 10 left. (Logged as a warn)\n\n\n### Interact With Database\n\nSome basic examples:\n\n```clojure\n(require '[discogs.database :as d])\n\n;; Search for artist productions\n\n(def results (d/search client {:artist \"Godflesh\"}))\n\n(-\u003e (group-by :type results)\n    (update-vals count)) ;; {\"release\" 376, \"master\" 35}\n\n;; Search for Masters \u0026 Versions\n\n(def master (d/get-master client 13153))\n(def versions (d/get-master-versions client 13153))\n\n(-\u003e\u003e (take 5 versions)\n     (map #(select-keys % [:title :released :label :id :catno]))\n     (clojure.pprint/print-table))\n;; |        :title | :released |  :label |      :id |    :catno |\n;; |---------------+-----------+---------+----------+-----------|\n;; | Streetcleaner |      1989 | Earache |    73735 | MOSH 15CD |\n;; | Streetcleaner |      1989 | Artrock |  2871848 |       A-3 |\n;; | Streetcleaner |      1989 | Earache |  7285314 | MOSH 15MC |\n;; | Streetcleaner |      1989 | Earache |  6841727 |   MOSH 15 |\n;; | Streetcleaner |      1989 | Earache | 14672296 |   MOSH 15 |\n```\n\n\u003e [!NOTE]\n\u003e See all the availables API methods on [CLJDOC](https://cljdoc.org/d/io.trosa/discogs/0.1.2/api/discogs)\n\n\n### Algorithms\n\n\u003e TODO\n\n## Disclaimer of Affiliation with Discogs\n\nThis software/library is an independent project developed by its author(s) and is not affiliated with, sponsored by,\nor endorsed by Discogs or any of its subsidiaries. \"Discogs\" is a registered trademark of Discogs Inc.\n\nThe use of the \"Discogs\" name and any related trademarks within this project is for identification and descriptive purposes only\nand does not imply any connection, endorsement, or approval by Discogs Inc.\n\n## License\n\nCopyright © 2025 iomonad\n\nThis program and the accompanying materials are made available under the\nterms of the Eclipse Public License 2.0 which is available at\nhttp://www.eclipse.org/legal/epl-2.0.\n\nThis Source Code may also be made available under the following Secondary\nLicenses when the conditions for such availability set forth in the Eclipse\nPublic License, v. 2.0 are satisfied: GNU General Public License as published by\nthe Free Software Foundation, either version 2 of the License, or (at your\noption) any later version, with the GNU Classpath Exception which is available\nat https://www.gnu.org/software/classpath/license.html.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiomonad%2Fdiscogs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiomonad%2Fdiscogs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiomonad%2Fdiscogs/lists"}