{"id":15435907,"url":"https://github.com/uetchy/muffledapi","last_synced_at":"2025-08-24T00:16:22.742Z","repository":{"id":34042381,"uuid":"166630017","full_name":"uetchy/MuffledAPI","owner":"uetchy","description":"Omnipotent API Client.","archived":false,"fork":false,"pushed_at":"2023-03-04T03:11:16.000Z","size":410,"stargazers_count":5,"open_issues_count":6,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T11:34:41.235Z","etag":null,"topics":["api","api-client","javascript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/uetchy.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}},"created_at":"2019-01-20T06:19:31.000Z","updated_at":"2025-02-15T00:59:00.000Z","dependencies_parsed_at":"2025-03-02T18:32:56.440Z","dependency_job_id":"06f7c5e4-06d4-48a6-8ba9-fe984e8ae34d","html_url":"https://github.com/uetchy/MuffledAPI","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uetchy%2FMuffledAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uetchy%2FMuffledAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uetchy%2FMuffledAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uetchy%2FMuffledAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uetchy","download_url":"https://codeload.github.com/uetchy/MuffledAPI/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249762262,"owners_count":21321901,"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","api-client","javascript"],"created_at":"2024-10-01T18:46:55.254Z","updated_at":"2025-04-19T18:23:49.921Z","avatar_url":"https://github.com/uetchy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Muffled API](https://uechi-public.s3.amazonaws.com/github/MuffledAPI/logo.png)\n\n[![Actions Status: test](https://github.com/uetchy/MuffledAPI/workflows/test/badge.svg)](https://github.com/uetchy/MuffledAPI/actions?query=test)\n[![npm version](https://img.shields.io/npm/v/muffled.svg)](https://www.npmjs.com/package/muffled)\n\n# Muffled API 🧣\n\n\u003e Omnipotent API Client armed with a power of `Proxy`.\n\n## Table of Contents\n\n- [Install](#install)\n- [Usage](#usage)\n- [API](#api)\n- [Maintainers](#maintainers)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Install\n\nYou can install Muffled API via `npm` or `yarn`.\n\n```bash\nnpm install muffled\nyarn add muffled\n```\n\n## Usage\n\n```js\nconst { Muffled, bearerAuth } = require(\"muffled\");\n\n/**\n * Spotify API\n */\nconst SpotifyAPI = new Muffled(\"api.spotify.com/v1\");\n\n// OAuth2 Bearer Authentication\nSpotifyAPI.use(bearerAuth(process.env.SPOTIFY_TOKEN));\n\n// This will fetch resource from `https://api.spotify.com/v1/search`\nconst result = await SpotifyAPI.search({\n  q: \"roadhouse blues\",\n  type: \"album,track\",\n});\n```\n\n## API\n\n### `new Muffled(endpoint: String)`\n\nThis will create a class for given endpoint.\n\nYou can also specify endpoint like:\n\n```js\nnew Muffled(\"api.spotify.com\");\nnew Muffled(\"https://api.spotify.com\");\nnew Muffled(\"https://api.spotify.com/v1\");\n```\n\n### API call\n\nYou can call any API query by passing property as a path string.\n\n```js\nnew Muffled(\"api.spotify.com\").v1.search({ limit: 1 }); // GET https://api.spotify.com/v1/search?limit=1\nnew Muffled(\"api.spotify.com/v1\").search({ limit: 1 }, { query: \"hey\" }); // POST https://api.spotify.com/v1/search?limit=1 -F '{\"query\": \"hey\"}' -H contnet-type=application/json\n\nnew Muffled(\"holodex.net/api/v2\").channels[\"UCMwGHR0BTZuLsmjY_NT5Pwg\"](); // GET https://holodex.net/api/v2/channels/UCMwGHR0BTZuLsmjY_NT5Pwg\n```\n\nYou can also call them using partial components:\n\n```js\nconst { user } = new Muffled(\"api.github.com\");\nconst userRepos = await user.repos();\n```\n\n### Method override\n\n```js\nconst client = new Muffled(\"holodex.net/api/v2\", {\n  overrides: {\n    \"/search\": {\n      method: \"POST\",\n    },\n  },\n});\n\nclient.search.videoSearch({ query: \"hey\" }); // POST https://holodex.net/api/v2/search/videoSearch -F '{\"query\": \"hey\"}' -H contnet-type=application/json\n```\n\n## Authorization\n\n### OAuth Bearer Token\n\n```js\nconst { Muffled, bearerAuth } = require(\"muffled\");\n\nconst API = new Muffled(\"api.github.com\");\n\nAPI.use(bearerAuth(process.env.GITHUB_TOKEN));\n\nAPI.user.repos(); // this will inject github token into Authorization header\n```\n\n### Generic Header Auth\n\n```js\nconst { Muffled, headerAuth } = require(\"muffled\");\n\nconst API = new Muffled(\"holodex.net\");\n\nAPI.use(headerAuth(\"x-apikey\", process.env.HOLODEX_TOKEN));\n\nAPI.live(); // this will inject apikey into x-apikey header\n```\n\n## Maintainers\n\n[@uetchy](https://github.com/uetchy)\n\n## Contributing\n\nPRs accepted.\n\nSmall note: If editing the README, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification.\n\n## License\n\nMIT © 2019 Yasuaki Uechi\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuetchy%2Fmuffledapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuetchy%2Fmuffledapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuetchy%2Fmuffledapi/lists"}