{"id":24731342,"url":"https://github.com/supadata-ai/js","last_synced_at":"2025-03-22T15:44:59.934Z","repository":{"id":274471191,"uuid":"922717541","full_name":"supadata-ai/js","owner":"supadata-ai","description":"Official TypeScript/JavaScript SDK for the Supadata API.","archived":false,"fork":false,"pushed_at":"2025-03-21T22:37:12.000Z","size":111,"stargazers_count":4,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-21T22:41:26.925Z","etag":null,"topics":["ai","crawler","llm","markdown","scraper","transcript","web-crawler","youtube"],"latest_commit_sha":null,"homepage":"https://supadata.ai","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/supadata-ai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-01-26T22:57:08.000Z","updated_at":"2025-03-21T22:37:15.000Z","dependencies_parsed_at":"2025-02-09T15:30:58.942Z","dependency_job_id":null,"html_url":"https://github.com/supadata-ai/js","commit_stats":null,"previous_names":["supadata-ai/js"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supadata-ai%2Fjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supadata-ai%2Fjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supadata-ai%2Fjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supadata-ai%2Fjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/supadata-ai","download_url":"https://codeload.github.com/supadata-ai/js/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244981292,"owners_count":20542288,"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":["ai","crawler","llm","markdown","scraper","transcript","web-crawler","youtube"],"created_at":"2025-01-27T16:47:59.192Z","updated_at":"2025-03-22T15:44:59.929Z","avatar_url":"https://github.com/supadata-ai.png","language":"TypeScript","readme":"# Supadata JS SDK\n\n[![NPM package](https://img.shields.io/npm/v/@supadata/js.svg?branch=main)](https://www.npmjs.com/package/@supadata/js)\n[![MIT license](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](http://opensource.org/licenses/MIT)\n\nThe official TypeScript/JavaScript SDK for Supadata.\n\nGet your free API key at [supadata.ai](https://supadata.ai) and start scraping data in minutes.\n\n## Installation\n\n```bash\nnpm install @supadata/js\n```\n\n## Usage\n\n```typescript\nimport {\n  Crawl,\n  CrawlJob,\n  Map,\n  Scrape,\n  Supadata,\n  Transcript,\n  YoutubeChannel,\n  YoutubePlaylist,\n  YoutubeVideo,\n} from '@supadata/js';\n\n// Initialize the client\nconst supadata = new Supadata({\n  apiKey: 'YOUR_API_KEY',\n});\n\n// Get YouTube transcript\nconst transcript: Transcript = await supadata.youtube.transcript({\n  url: 'https://youtu.be/dQw4w9WgXcQ',\n});\n\n// Translate YouTube transcript\nconst translated: Transcript = await supadata.youtube.translate({\n  videoId: 'dQw4w9WgXcQ',\n  lang: 'es',\n});\n\n// Get a YouTube Video metadata\nconst video: YoutubeVideo = await supadata.youtube.video({\n  id: 'dQw4w9WgXcQ', // can be url or video id\n});\n\n// Get a YouTube channel metadata\nconst channel: YoutubeChannel = await supadata.youtube.channel({\n  id: 'https://youtube.com/@RickAstleyVEVO', // can be url, channel id, handle\n});\n\n// Get a list of video IDs from a YouTube channel\nconst channelVideos: string[] = await supadata.youtube.channel.videos({\n  id: 'https://youtube.com/@RickAstleyVEVO', // can be url, channel id, handle\n});\n\n// Get the metadata of a YouTube playlist\nconst playlist: YoutubePlaylist = await supadata.youtube.playlist({\n  id: 'PLFgquLnL59alCl_2TQvOiD5Vgm1hCaGSI', // can be url or playlist id\n});\n\n// Get a list of video IDs from a YouTube playlist\nconst playlistVideos: string[] = await supadata.youtube.playlist.videos({\n  id: 'https://www.youtube.com/playlist?list=PLlaN88a7y2_plecYoJxvRFTLHVbIVAOoc', // can be url or playlist id\n});\n\n// Scrape web content\nconst webContent: Scrape = await supadata.web.scrape('https://supadata.ai');\n\n// Map website URLs\nconst siteMap: Map = await supadata.web.map('https://supadata.ai');\n\n// Crawl website\nconst crawl: Crawl = await supadata.web.crawl({\n  url: 'https://supadata.ai',\n  limit: 10,\n});\n\n// Get crawl job results\nconst crawlResults: CrawlJob = await supadata.web.getCrawlResults(crawl.jobId);\n```\n\n## Error Handling\n\nThe SDK throws `SupadataError` for API-related errors. You can catch and handle these errors as follows:\n\n```typescript\nimport { SupadataError } from '@supadata/js';\n\ntry {\n  const transcript = await supadata.youtube.transcript({\n    videoId: 'INVALID_ID',\n  });\n} catch (e) {\n  if (e instanceof SupadataError) {\n    console.error(e.error); // e.g., 'video-not-found'\n    console.error(e.message); // Human readable error message\n    console.error(e.details); // Detailed error description\n    console.error(e.documentationUrl); // Link to error documentation (optional)\n  }\n}\n```\n\n## Example\n\nSee the [example](./example) directory for a simple example of how to use the SDK.\n\n## API Reference\n\nSee the [Documentation](https://supadata.ai/documentation) for more details on all possible parameters and options.\n\n## License\n\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsupadata-ai%2Fjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsupadata-ai%2Fjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsupadata-ai%2Fjs/lists"}