Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sylv/gfycat-api
An unofficial library for getting data from gfycat and redgifs.
https://github.com/sylv/gfycat-api
Last synced: 17 days ago
JSON representation
An unofficial library for getting data from gfycat and redgifs.
- Host: GitHub
- URL: https://github.com/sylv/gfycat-api
- Owner: sylv
- License: mit
- Created: 2021-07-29T00:45:37.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-08-09T13:16:50.000Z (over 3 years ago)
- Last Synced: 2025-01-05T06:08:06.772Z (19 days ago)
- Language: TypeScript
- Homepage:
- Size: 123 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gfycat-api
**This is not an official API in any way, and may break without warning.**
An API for getting posts from [gfycat](https://www.gfycat.com/) and [redgifs](https://redgifs.com/). See [tests](/test) for examples. May or may not work in the browser because it seems they gave up on CORS and allow anything.
```ts
import { gfycat, redgifs } from "gfycat-api";const post = await gfycat.getPost("aridblindharvestmouse");
console.log(post);
// {
// id: 'AridBlindHarvestmouse',
// title: 'Fortnite default dance meme',
// source: 'https://gfycat.com/MadeupBossyFish',
// description: undefined,
// rating: 'PG-13',
// posterUrl: 'https://thumbs.gfycat.com/AridBlindHarvestmouse-poster.jpg',
// tags: [ 'People & Blogs', 'Thefortnite Alert' ],
// nsfw: false,
// md5: undefined,
// createdAt: 2018-09-25T07:27:30.000Z,
// author: undefined,
// votes: { likes: 4, dislikes: 0 },
// resolution: { height: 480, width: 480 },
// sources: [
// {
// type: 'max1mbGif',
// url: 'https://thumbs.gfycat.com/AridBlindHarvestmouse-max-1mb.gif',
// height: 280,
// width: 280,
// size: 909875
// },
// {
// type: 'webm',
// url: 'https://giant.gfycat.com/AridBlindHarvestmouse.webm',
// height: 480,
// width: 480,
// size: 380532
// },
// ...
// ],
// meta: {
// frameRate: 30.03003,
// frameCount: 200,
// hasAudio: false,
// hasTransparency: false,
// averageColour: '#E3FFFE'
// }
// }
```# todo
- [ ] Some posts have URLs that outright don't work, we should try filter these out. An example is [this post](https://api.gfycat.com/v1/gfycats/AnchoredGlaringArmadillo) where the "largeGif" source doesn't work. This seems to be random and isn't just restricted to urls in `content_urls`, but the website must filter them out somehow so it should be possible for us to do the same.