{"id":19498107,"url":"https://github.com/patrickalphac/spotify_cl_ea","last_synced_at":"2025-08-07T14:33:56.487Z","repository":{"id":38895571,"uuid":"260751937","full_name":"PatrickAlphaC/spotify_cl_ea","owner":"PatrickAlphaC","description":"spotify chainlink external adapter","archived":false,"fork":false,"pushed_at":"2023-01-23T22:07:29.000Z","size":49,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-08T09:49:47.118Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/PatrickAlphaC.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-05-02T18:40:20.000Z","updated_at":"2022-06-23T18:34:39.000Z","dependencies_parsed_at":"2023-02-13T03:55:11.608Z","dependency_job_id":null,"html_url":"https://github.com/PatrickAlphaC/spotify_cl_ea","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickAlphaC%2Fspotify_cl_ea","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickAlphaC%2Fspotify_cl_ea/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickAlphaC%2Fspotify_cl_ea/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatrickAlphaC%2Fspotify_cl_ea/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PatrickAlphaC","download_url":"https://codeload.github.com/PatrickAlphaC/spotify_cl_ea/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240746947,"owners_count":19850995,"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":[],"created_at":"2024-11-10T21:49:15.553Z","updated_at":"2025-02-25T21:14:59.747Z","avatar_url":"https://github.com/PatrickAlphaC.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Spotify Adadpter\n\n# For Contract Developers wanting to use the adapter\n\nThis job is currently hosted on node `0xB36d3709e22F7c708348E225b20b13eA546E6D9c` with job ID `903c5a53e95141218e2784a6142f53a5`\n\nPlease check out sample.sol for some sample use of getting data from the adapter.\n\nFollow the instructions from: https://docs.chain.link/docs/example-walkthrough, but instead of using `ATestNetConsumer.sol` use `sample.sol` from this repo. And in `requestPopularity` enter the artist ID. \n![](img/requestPopularity.png)\n\n\n### For external adapter developers and node operators\n\n**Adapter Formats**: Google Cloud Function, AWS Lambda and Docker\n\n**All Endpoints (functions) supported** \n\n## Cloud Installation:\nMake the bash script executable\n\n```chmod +x ./create_zip.bsh```\n\nCreate the adapter zip for your cloud provider ( gcs or aws )\n\n```./create_zip.bsh aws```\n\nUpload the created zip to your provider and set the appropriate handler ( gcs_handler or aws_handler ) to be triggered by a HTTP event.\n\nFunction to execute: \"gcs_handler\"\n\nYou'll need two environment variables:\n`SPOTIPY_CLIENT_ID`\n`SPOTIPY_CLIENT_SECRET`\n\nYou can get them from the [spotify developers page](https://developer.spotify.com/)\n\n\n## Docker Installation:\nBuild the image\n```\ndocker build -t spotify_cl_ea .\n```\nRun the container while passing in your SPOTIPY_CLIENT_ID and SPOTIPY_CLIENT_SECRET\n```\ndocker run -e SPOTIPY_CLIENT_ID=************** -e SPOTIPY_CLIENT_SECRET=************* -p 5000:5000 spotify_cl_ea\n```\nThe adapter endpoint will be accessable from ```http://localhost/:5000/spotify_cl_ea```\n\n## Sample call:\n```\ncurl -X POST \"https://us-central1-chainlink-256615.cloudfunctions.net/function-1\" -H \"Content-Type:application/json\" --data '{\"data\": {\"artist\": \"246dkjvS1zLTtiykXe5h60\"}}'\n```\nSample return:\n```\n{\n  \"external_urls\": {\n    \"spotify\": \"https://open.spotify.com/artist/246dkjvS1zLTtiykXe5h60\"\n  },\n  \"followers\": {\n    \"href\": null,\n    \"total\": 24543702\n  },\n  \"genres\": [\n    \"dfw rap\",\n    \"melodic rap\",\n    \"rap\"\n  ],\n  \"href\": \"https://api.spotify.com/v1/artists/246dkjvS1zLTtiykXe5h60\",\n  \"id\": \"246dkjvS1zLTtiykXe5h60\",\n  \"images\": [\n    {\n      \"height\": 640,\n      \"url\": \"https://i.scdn.co/image/93fec27f9aac86526b9010e882037afbda4e3d5f\",\n      \"width\": 640\n    },\n    {\n      \"height\": 320,\n      \"url\": \"https://i.scdn.co/image/9040899d5660920fdf7efeb7aa2cc4e6d86f86f6\",\n      \"width\": 320\n    },\n    {\n      \"height\": 160,\n      \"url\": \"https://i.scdn.co/image/d15a5ffb3d22adabd09a749e09e846f527ab5a94\",\n      \"width\": 160\n    }\n  ],\n  \"name\": \"Post Malone\",\n  \"popularity\": 96,\n  \"type\": \"artist\",\n  \"uri\": \"spotify:artist:246dkjvS1zLTtiykXe5h60\"\n}\n```\n\n## Sample Job Spec\n```\n{\n  \"initiators\": [\n    {\n      \"type\": \"runlog\",\n      \"params\": {\n        \"address\": \"0xb36d3709e22f7c708348e225b20b13ea546e6d9c\"\n      }\n    }\n  ],\n  \"tasks\": [\n    {\n      \"type\": \"spotify-adapter\",\n      \"confirmations\": null,\n      \"params\": {\n      }\n    },\n    {\n      \"type\": \"copy\",\n      \"confirmations\": null,\n      \"params\": {\n      }\n    },\n    {\n      \"type\": \"multiply\",\n      \"confirmations\": null,\n      \"params\": {\n      }\n    },\n    {\n      \"type\": \"ethuint256\",\n      \"confirmations\": null,\n      \"params\": {\n      }\n    },\n    {\n      \"type\": \"ethtx\",\n      \"confirmations\": null,\n      \"params\": {\n      }\n    }\n  ],\n  \"startAt\": null,\n  \"endAt\": null\n}\n```\n\n\n## Testing\n# Currently broken\n\nTo test just the URL creation run:\n```python -m pytest -k test_url_creation```\n\nOnce you have ```test_config.json``` set up, you can run each appropriatly depending on your setup.\n\nIf you have a docker, aws, and gcp setup, feel free to run:\n```python -m pytest```\n\n```test_data.json``` contains example payloads for some supported endpoints, paths and their parameters.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickalphac%2Fspotify_cl_ea","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatrickalphac%2Fspotify_cl_ea","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickalphac%2Fspotify_cl_ea/lists"}