https://github.com/whosydd/carbon-api
API for carbon.now.sh
https://github.com/whosydd/carbon-api
api carbon-now-sh vercel-serverless
Last synced: 2 months ago
JSON representation
API for carbon.now.sh
- Host: GitHub
- URL: https://github.com/whosydd/carbon-api
- Owner: whosydd
- License: mit
- Created: 2022-12-10T09:57:37.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-07T06:48:56.000Z (over 3 years ago)
- Last Synced: 2025-06-13T16:06:38.100Z (about 1 year ago)
- Topics: api, carbon-now-sh, vercel-serverless
- Language: TypeScript
- Homepage: https://carbon-api.vercel.app/
- Size: 120 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# carbon-api
## Usage
- url: `https://carbon-api.vercel.app/api`
- method: `POST`
- request.body: `code`, `theme`
- optional theme: `3024 Night`, `A11y Dark`, `Blackboard`, `Base 16 (Dark)`, `Cobalt`, `Dracula ProPurchase`, `Duotone`, `Hopscotch`, `Lucario`, `Material`, `Monokai`, `Night Owl`, `Nord`, `Oceanic Next`, `One Light`, `One Dark`, `Panda`, `Paraiso`, `Seti`, `Shades of Purple`, `Solarized (Dark)`, `Solarized (Light)`, `SynthWave '84`, `Twilight`, `Verminal`, `VSCode`, `Yeti`, `Zenburn`
- response.data: `ArrayBuffer`
```js
const res = await axios.post(
`https://carbon-api.vercel.app/api`,
{ code, theme },
{ responseType: 'arraybuffer' }
)
```
## Vercel
[](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fwhosydd%2Fcarbon-api)
## Known issues
The maximum execution timeout is **10 seconds** when deployed on a Personal Account (Hobby plan). [read more](https://vercel.com/docs/concepts/limits/overview#serverless-function-execution-timeout)
If you got error code `FUNCTION_INVOCATION_TIMEOUT`, please retry.