{"id":13626497,"url":"https://github.com/openapistack/openapi-client-axios","last_synced_at":"2025-05-14T05:10:23.725Z","repository":{"id":39542473,"uuid":"157976175","full_name":"openapistack/openapi-client-axios","owner":"openapistack","description":"JavaScript client library for consuming OpenAPI-enabled APIs with axios","archived":false,"fork":false,"pushed_at":"2025-04-14T05:07:43.000Z","size":3182,"stargazers_count":590,"open_issues_count":26,"forks_count":68,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-05-13T18:36:16.978Z","etag":null,"topics":["axios","hacktoberfest","openapi","swagger","typescript"],"latest_commit_sha":null,"homepage":"https://openapistack.co","language":"TypeScript","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/openapistack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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},"funding":{"github":"anttiviljami","open_collective":"openapi-stack","custom":["https://buymeacoff.ee/anttiviljami"]}},"created_at":"2018-11-17T11:04:15.000Z","updated_at":"2025-05-06T13:50:38.000Z","dependencies_parsed_at":"2024-04-16T22:50:58.116Z","dependency_job_id":"9be5e468-694d-440e-b799-f9ed7ae48e3d","html_url":"https://github.com/openapistack/openapi-client-axios","commit_stats":{"total_commits":384,"total_committers":35,"mean_commits":"10.971428571428572","dds":0.6588541666666667,"last_synced_commit":"66bc2a5a075954ca4c599f6df507d757bd531b8c"},"previous_names":["anttiviljami/openapi-frontend","openapistack/openapi-client-axios","anttiviljami/openapi-client-axios"],"tags_count":157,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openapistack%2Fopenapi-client-axios","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openapistack%2Fopenapi-client-axios/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openapistack%2Fopenapi-client-axios/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openapistack%2Fopenapi-client-axios/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openapistack","download_url":"https://codeload.github.com/openapistack/openapi-client-axios/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254076850,"owners_count":22010611,"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":["axios","hacktoberfest","openapi","swagger","typescript"],"created_at":"2024-08-01T21:02:20.522Z","updated_at":"2025-05-14T05:10:23.694Z","avatar_url":"https://github.com/openapistack.png","language":"TypeScript","funding_links":["https://github.com/sponsors/anttiviljami","https://opencollective.com/openapi-stack","https://buymeacoff.ee/anttiviljami"],"categories":["TypeScript","typescript"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\u003cimg alt=\"openapi-client-axios\" src=\"https://github.com/openapistack/openapi-client-axios/raw/main/header.png?raw=true\" style=\"max-width:50rem\"\u003e\u003c/h1\u003e\n\n[![CI](https://github.com/openapistack/openapi-client-axios/workflows/CI/badge.svg)](https://github.com/openapistack/openapi-client-axios/actions?query=workflow%3ACI)\n[![License](http://img.shields.io/:license-mit-blue.svg)](https://github.com/openapistack/openapi-client-axios/blob/main/LICENSE)\n[![npm version](https://img.shields.io/npm/v/openapi-client-axios.svg)](https://www.npmjs.com/package/openapi-client-axios)\n[![npm downloads](https://img.shields.io/npm/dw/openapi-client-axios.svg)](https://www.npmjs.com/package/openapi-client-axios)\n[![bundle size](https://img.shields.io/bundlephobia/minzip/openapi-client-axios.svg?label=gzip%20bundle)](https://bundlephobia.com/package/openapi-client-axios)\n[![Libraries.io dependency status for latest release](https://img.shields.io/librariesio/release/npm/openapi-client-axios.svg)](https://www.npmjs.com/package/openapi-client-axios?activeTab=dependencies)\n![npm type definitions](https://img.shields.io/npm/types/openapi-client-axios.svg)\n[![Buy me a coffee](https://img.shields.io/badge/donate-buy%20me%20a%20coffee-orange)](https://buymeacoff.ee/anttiviljami)\n\n\u003cp align=\"center\"\u003eJavaScript client library for consuming OpenAPI-enabled APIs with \u003ca href=\"https://github.com/axios/axios\" target=\"_blank\"\u003eaxios\u003c/a\u003e. Types included.\u003c/p\u003e\n\n## Features\n\n- [x] Create API clients from [OpenAPI v3 definitions](https://github.com/OAI/OpenAPI-Specification)\n- [x] Client is configured in runtime. **No generated code!**\n- [x] Generate TypeScript definitions (.d.ts) for your APIs with full IntelliSense support\n- [x] Easy to use API to call API operations using JavaScript methods\n  - `client.getPet(1)`\n  - `client.searchPets()`\n  - `client.searchPets({ ids: [1, 2, 3] })`\n  - `client.updatePet(1, payload)`\n- [x] Built on top of the robust [axios](https://github.com/axios/axios) JavaScript library\n- [x] Isomorphic, works both in browser and Node.js\n\n## Documentation\n\n**New!** OpenAPI Client Axios documentation is now found on [openapistack.co](https://openapistack.co)\n\nhttps://openapistack.co/docs/openapi-client-axios/intro\n\n## Quick Start\n\n```\nnpm install --save axios openapi-client-axios\n```\n\n```\nyarn add axios openapi-client-axios\n```\n\nWith promises / CommonJS syntax:\n\n```javascript\nconst OpenAPIClientAxios = require('openapi-client-axios').default;\n\nconst api = new OpenAPIClientAxios({ definition: 'https://example.com/api/openapi.json' });\napi.init()\n  .then(client =\u003e client.getPetById(1))\n  .then(res =\u003e console.log('Here is pet id:1 from the api', res.data));\n```\n\nWith async-await / ES6 syntax:\n\n```javascript\nimport OpenAPIClientAxios from 'openapi-client-axios';\n\nconst api = new OpenAPIClientAxios({ definition: 'https://example.com/api/openapi.json' });\napi.init();\n\nasync function createPet() {\n  const client = await api.getClient();\n  const res = await client.createPet(null, { name: 'Garfield' });\n  console.log('Pet created', res.data);\n}\n```\n\n## Typesafe Clients\n\n![TypeScript IntelliSense](https://github.com/openapistack/openapi-client-axios/blob/main/packages/typegen/intellisense.gif)\n\n`openapi-client-axios` comes with a CLI command `openapicmd typegen` to generate Typescript types for type safety and code autocomplete.\n\n```\nnpx openapicmd typegen ./openapi.yaml \u003e src/types/openapi.d.ts\n```\n\nThe output of `typegen` exports a type called `Client`, which can be used for instances created with `OpenAPIClientAxios`.\n\nBoth the `api.getClient()` and `api.init()` methods support passing in a Client type.\n\n```typescript\nimport { Client as PetStoreClient } from './client.d.ts';\n\nconst client = await api.init\u003cPetStoreClient\u003e();\nconst client = await api.getClient\u003cPetStoreClient\u003e();\n```\n\n`openapicmd typegen` supports using both local and remote URLs for OpenAPI definition files.\n\n```\n$ npx openapicmd typegen ./petstore.yaml\n$ npx openapicmd typegen https://petstore3.swagger.io/api/v3/openapi.json\n```\n\n## Commercial support\n\nFor assistance with openapi-client-axios in your company, reach out at support@openapistack.co.\n\n## Contributing\n\nOpenAPI Client Axios is Free and Open Source Software. Issues and pull requests are more than welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenapistack%2Fopenapi-client-axios","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenapistack%2Fopenapi-client-axios","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenapistack%2Fopenapi-client-axios/lists"}