{"id":23400097,"url":"https://github.com/khalby786/getxkcd","last_synced_at":"2025-09-03T03:42:00.685Z","repository":{"id":106873761,"uuid":"294582349","full_name":"khalby786/getxkcd","owner":"khalby786","description":"xkcd api with cors","archived":false,"fork":false,"pushed_at":"2024-02-19T15:55:32.000Z","size":28,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-11T18:03:56.150Z","etag":null,"topics":["api","cors","go","golang","xkcd","xkcd-api","xkcd-comics","xkcd-scraper"],"latest_commit_sha":null,"homepage":"https://getxkcd.now.sh","language":"Go","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/khalby786.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,"zenodo":null}},"created_at":"2020-09-11T03:16:28.000Z","updated_at":"2025-01-14T15:58:19.000Z","dependencies_parsed_at":"2024-01-27T07:29:08.568Z","dependency_job_id":"5a7b9fab-ef81-486d-b226-e78312b69445","html_url":"https://github.com/khalby786/getxkcd","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khalby786%2Fgetxkcd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khalby786%2Fgetxkcd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khalby786%2Fgetxkcd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khalby786%2Fgetxkcd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/khalby786","download_url":"https://codeload.github.com/khalby786/getxkcd/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248456374,"owners_count":21106602,"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","cors","go","golang","xkcd","xkcd-api","xkcd-comics","xkcd-scraper"],"created_at":"2024-12-22T10:19:31.336Z","updated_at":"2025-04-11T18:07:37.718Z","avatar_url":"https://github.com/khalby786.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# getxkcd\n\n[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fkhalby786%2Fgetxkcd)\n\n\n### get the latest comic\n\nhttps://getxkcd.now.sh/latest\u003cbr /\u003e\nhttps://getxkcd.now.sh/0\u003cbr /\u003e\n\n#### example response\n\n```json\n{\n  \"month\": \"1\",\n  \"num\": 2886,\n  \"link\": \"\",\n  \"year\": \"2024\",\n  \"news\": \"\",\n  \"safe_title\": \"Fast Radio Bursts\",\n  \"transcript\": \"\",\n  \"alt\": \"Dr. Petroff has also shown that the Higgs boson signal was actually sparks from someone microwaving grapes, the EHT black hole photo was a frozen bagel someone left in too long, and the LIGO detection was just someone slamming the microwave door too hard.\",\n  \"img\": \"https://imgs.xkcd.com/comics/fast_radio_bursts.png\",\n  \"title\": \"Fast Radio Bursts\",\n  \"day\": \"26\"\n}\n```\n\n### get a comic by number\n\nhttps://getxkcd.now.sh/1481\n\n#### example response\n\n```json\n{\n  \"month\": \"2\",\n  \"num\": 1481,\n  \"link\": \"\",\n  \"year\": \"2015\",\n  \"news\": \"\",\n  \"safe_title\": \"API\",\n  \"transcript\": \"((This is a faux-screenshot of a technical document))\\n[[A figure sits at a computer upon a desk, apparently engrossed in the document which we now see before us.]]\\nTITLE: API GUIDE\\nRequest URL Format: domain\\nuser\\nitem\\nServer will return an XML document which contains the requested data and documentation describing how the data is organized spatially.\\nAPI KEYS: To obtain API access, contact the x.509-authenticated server and request an ECDH-RSA TLS key...\\n\\nCaption: If you do things right, it can take people a while to realize that your \\\"API documentation\\\" is just instructions for how to look at your website.\\n\\n{{Title text: ACCESS LIMITS: Clients may maintain connections to the server for no more than 86,400 seconds per day. If you need additional time, you may contact IERS to file a request for up to one additional second.}}\",\n  \"alt\": \"ACCESS LIMITS: Clients may maintain connections to the server for no more than 86,400 seconds per day. If you need additional time, you may contact IERS to file a request for up to one additional second.\",\n  \"img\": \"https://imgs.xkcd.com/comics/api.png\",\n  \"title\": \"API\",\n  \"day\": \"2\"\n}\n```\n\n## notes\n\n- you can also get the latest comic by sending a request to https://getxkcd.now.sh/, but the request header should have `Accept` as `application/json`\n\n\n  ```bash\n  curl -H \"Accept: application/json\" \"https://getxkcd.now.sh/\"\"\n  ```\n\n- the API is [backwards compatible](https://xkcd.com/1172/) with the previous versions which used https://getxkcd.now.sh/api/comic?num=latest to get the latest comic and https://getxkcd.now.sh/api/comic?num=1172 to get a particular comic\n- if you get an HTML response from the API, you have to set your API client to handle redirects. alternatively, replace `.now.sh` domains with `.vercel.app` to avoid this pitfall in places like `curl`\n- `vercel.json` handles all the routing, so make sure you copy it verbatim if you want good things to happen\n- in an effort to learn and use a new programming language, i have used go which is unnecessarily complicating things but *✨ performance ✨* \n\n## closing thoughts\n\nmade by [khaleel](https://khaleelgibran.com) when he was feeling lonely","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhalby786%2Fgetxkcd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkhalby786%2Fgetxkcd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhalby786%2Fgetxkcd/lists"}