{"id":26891176,"url":"https://github.com/asbdaryaee/facts-api","last_synced_at":"2026-04-27T00:31:49.702Z","repository":{"id":285418269,"uuid":"958076603","full_name":"AsbDaryaee/facts-api","owner":"AsbDaryaee","description":"A high-performance REST API for interesting facts across multiple domains, built with Bun.","archived":false,"fork":false,"pushed_at":"2025-05-09T13:01:13.000Z","size":68,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-09T14:22:20.547Z","etag":null,"topics":["api","bun","public-api","typescript"],"latest_commit_sha":null,"homepage":"https://f-api.ir","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/AsbDaryaee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2025-03-31T15:51:53.000Z","updated_at":"2025-05-09T13:01:17.000Z","dependencies_parsed_at":"2025-04-07T18:33:36.931Z","dependency_job_id":null,"html_url":"https://github.com/AsbDaryaee/facts-api","commit_stats":null,"previous_names":["asbdaryaee/facts-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AsbDaryaee/facts-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AsbDaryaee%2Ffacts-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AsbDaryaee%2Ffacts-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AsbDaryaee%2Ffacts-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AsbDaryaee%2Ffacts-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AsbDaryaee","download_url":"https://codeload.github.com/AsbDaryaee/facts-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AsbDaryaee%2Ffacts-api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262900188,"owners_count":23381663,"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","bun","public-api","typescript"],"created_at":"2025-03-31T22:33:11.524Z","updated_at":"2026-04-27T00:31:49.690Z","avatar_url":"https://github.com/AsbDaryaee.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Facts API\n\nA high-performance REST API for interesting facts across multiple domains, built with Bun.\n\n## 📚 Overview\n\nThis API provides access to a curated collection of 200 fascinating facts across seven categories:\n\n- 🌌 Astronomy\n- 🔬 Biology\n- ⚛️ Physics\n- 🦁 Animals\n- 📜 History\n- 💻 Technology\n- 🌍 Global Warming\n\nEach fact includes detailed metadata such as verification status, sources, discovery year, and interest rating.\n\n## Endpoints\n\n### Get All Facts\n\nRetrieves a list of facts with optional filtering.\n\n**URL:** `/api/facts`  \n**Method:** `GET`  \n**Query Parameters:**\n\n- `limit` (optional): Maximum number of facts to return\n- `verified` (optional): Filter by verification status (true/false)\n\n**Success Response:**\n\n- **Code:** 200\n- **Content:** Array of Fact objects\n\n**Example Request:**\n\n```\nGET /api/facts?limit=5\u0026verified=true\n```\n\n### Get Random Fact\n\nRetrieves a single random fact from the facts collection.\n\n**URL:** `/api/facts/random`  \n**Method:** `GET`\n\n**Success Response:**\n\n- **Code:** 200\n- **Content:** Single Fact object\n\n**Example Request:**\n\n```\nGET /api/facts/random\n```\n\n**Example Response:**\n\n```json\n{\n  \"id\": 15,\n  \"title\": \"Octopus Intelligence\",\n  \"fact\": \"Octopuses are highly intelligent and have been observed using tools, solving puzzles, and even escaping from aquariums.\",\n  \"category\": \"animals\",\n  \"verified\": true\n}\n```\n\n### Get Fact by ID\n\nRetrieves a specific fact by its ID.\n\n**URL:** `/api/facts/:id`  \n**Method:** `GET`  \n**URL Parameters:**\n\n- `id`: The numeric ID of the fact\n\n**Success Response:**\n\n- **Code:** 200\n- **Content:** Fact object\n\n**Error Response:**\n\n- **Code:** 404\n- **Content:** `{ \"error\": \"Fact not found\" }`\n\n**Example Request:**\n\n```\nGET /api/facts/42\n```\n\n### Get Facts by Category\n\nRetrieves all facts belonging to a specific category.\n\n**URL:** `/api/facts/category/:category`  \n**Method:** `GET`  \n**URL Parameters:**\n\n- `category`: The category name\n\n**Success Response:**\n\n- **Code:** 200\n- **Content:** Array of Fact objects\n\n**Example Request:**\n\n```\nGET /api/facts/category/science\n```\n\n### Search Facts\n\nSearches for facts containing the specified query in title, content, or category.\n\n**URL:** `/api/facts/search`  \n**Method:** `GET`  \n**Query Parameters:**\n\n- `q`: The search query\n\n**Success Response:**\n\n- **Code:** 200\n- **Content:** Array of Fact objects\n\n**Example Request:**\n\n```\nGET /api/facts/search?q=dinosaur\n```\n\n## Fact Object Structure\n\n```typescript\ninterface Fact {\n  id: number;\n  category: Categories;\n  title: string;\n  fact: string;\n  verified: boolean;\n  source: string;\n  year_discovered: number;\n  interesting_rating: number;\n}\n```\n\n## 📝 Data Attribution\n\nAll facts in this API were curated and provided by Claude AI (Anthropic Claude 3.7 Sonnet).\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## 🤝 Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n---\n\nMade with ❤️ and powered by [Bun](https://bun.sh/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasbdaryaee%2Ffacts-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasbdaryaee%2Ffacts-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasbdaryaee%2Ffacts-api/lists"}