{"id":15408430,"url":"https://github.com/yusukebe/ramen-api","last_synced_at":"2025-04-05T05:03:37.230Z","repository":{"id":41960424,"uuid":"475239664","full_name":"yusukebe/ramen-api","owner":"yusukebe","description":"Web API about 🍜","archived":false,"fork":false,"pushed_at":"2025-03-16T05:48:46.000Z","size":9554,"stargazers_count":143,"open_issues_count":5,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T04:04:09.159Z","etag":null,"topics":["api","cloudflare-workers","graphql","ramen","typescript"],"latest_commit_sha":null,"homepage":"https://ramen-api.dev/shops/yoshimuraya?pretty","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/yusukebe.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}},"created_at":"2022-03-29T01:38:54.000Z","updated_at":"2025-03-25T09:14:02.000Z","dependencies_parsed_at":"2024-01-12T19:06:39.416Z","dependency_job_id":"6f7067af-8e6f-438f-ab1a-717c4714bf0a","html_url":"https://github.com/yusukebe/ramen-api","commit_stats":{"total_commits":91,"total_committers":5,"mean_commits":18.2,"dds":0.06593406593406592,"last_synced_commit":"57e1afa4bae4a4a0329b0b384f9b200cc91c1bf8"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yusukebe%2Framen-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yusukebe%2Framen-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yusukebe%2Framen-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yusukebe%2Framen-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yusukebe","download_url":"https://codeload.github.com/yusukebe/ramen-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247289409,"owners_count":20914464,"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","cloudflare-workers","graphql","ramen","typescript"],"created_at":"2024-10-01T16:33:58.560Z","updated_at":"2025-04-05T05:03:37.197Z","avatar_url":"https://github.com/yusukebe.png","language":"TypeScript","readme":"# Ramen API :ramen:\n\n**Ramen API** is a free Web API about :ramen:.\nThis API is designed for the purpose of testing a software application which is accessing Web APIs.\nFor example, you can use Ramen API for prototyping your React, Vue, or Angular web pages.\n\nYou can try Ramen API with this code.\n\n```js\nfetch('https://ramen-api.dev/shops/yoshimuraya')\n  .then((res) =\u003e res.json())\n  .then((json) =\u003e console.log(json.shop.name)) // =\u003e 吉村家\n```\n\nThis repository manages the source code and the content including photos.\n\nYou might want to say _why Ramen?_ And, I will say. **_:ramen: is super delicious!! :yum:_**\n\n## Features\n\n- :star2: Support REST API and GraphQL.\n- :framed_picture: We can get an information of Ramen shops and their rich photos.\n- :free: Completely free.\n- :technologist: You can contribute by adding Ramen content.\n\n## Information\n\n- **Currently, Ramen API is a beta version**. There's a possibility that API may be changed.\n- You **should** show the credit like \"_powered by Ramen API_\" on your page and link to this GitHub repository.\n- The information of Ramen shops and photos are distributed under the [Creative Commons copyright license _CC/BY_](https://creativecommons.org/licenses/by-sa/4.0/legalcode).\n- If you want to use photos in your application publicly, you **should** show the author `id` or `name` of the photos as the credit.\n- Authentication is not required.\n- There is no rate-limitation.\n\n## Base URL\n\n```\nhttps://ramen-api.dev\n```\n\n## TypeScript Types\n\n```ts\ntype Photo = {\n  name: string\n  url: string\n  width: number\n  height: number\n  authorId?: string\n  author?: Author\n}\n\ntype Shop = {\n  id: string\n  name?: string\n  photos?: Photo[]\n}\n\ntype Author = {\n  id: string\n  name: string\n  url: string\n}\n```\n\n## REST API\n\n![SS](https://user-images.githubusercontent.com/10682/163718724-1dbe9ea5-6dda-47ae-962b-1657e157c64a.png)\n\n### Global parameters\n\n- `pretty` - Flag of JSON pretty printing.\n\n### GET `/shops`\n\n#### Parameters\n\n- `page` - default is `1`.\n- `perPage` - default is `10`. Maximum value is `100`.\n\n#### Examples\n\n```http\nGET /shops?pretty\u0026page=1\u0026perPage=3\n```\n\n```json\n{\n  \"shops\": [\n    {\n      \"id\": \"yoshimuraya\",\n      \"name\": \"吉村家\",\n      \"photos\": [\n        {\n          \"name\": \"yoshimuraya-001.jpg\",\n          \"width\": 1200,\n          \"height\": 900,\n          \"authorId\": \"yusukebe\",\n          \"url\": \"https://ramen-api.dev/images/yoshimuraya/yoshimuraya-001.jpg\"\n        }\n      ]\n    },\n    {\n      \"id\": \"sugitaya\",\n      \"name\": \"杉田家\",\n      \"photos\": [\n        {\n          \"name\": \"sugitaya-001.jpg\",\n          \"width\": 1200,\n          \"height\": 900,\n          \"authorId\": \"yusukebe\",\n          \"url\": \"https://ramen-api.dev/images/sugitaya/sugitaya-001.jpg\"\n        }\n      ]\n    },\n    {\n      \"id\": \"takasagoya\",\n      \"name\": \"たかさご家\",\n      \"photos\": [\n        {\n          \"name\": \"takasagoya-001.jpg\",\n          \"width\": 1200,\n          \"height\": 900,\n          \"authorId\": \"yusukebe\",\n          \"url\": \"https://ramen-api.dev/images/takasagoya/takasagoya-001.jpg\"\n        }\n      ]\n    }\n  ],\n  \"totalCount\": 7,\n  \"pageInfo\": {\n    \"nextPage\": 2,\n    \"prevPage\": null,\n    \"lastPage\": 3,\n    \"perPage\": 3,\n    \"currentPage\": 1\n  }\n}\n```\n\n### GET `/shops/{shopId}`\n\n#### Examples\n\n```http\nGET /shops/yoshimuraya\n```\n\n```json\n{\n  \"shop\": {\n    \"id\": \"yoshimuraya\",\n    \"name\": \"吉村家\",\n    \"photos\": [\n      {\n        \"name\": \"yoshimuraya-001.jpg\",\n        \"width\": 1200,\n        \"height\": 900,\n        \"author\": \"yusukebe\",\n        \"url\": \"https://ramen-api.dev/images/yoshimuraya/yoshimuraya-001.jpg\"\n      }\n    ]\n  }\n}\n```\n\n### GET `/authors/{authorId}`\n\n#### Examples\n\n```http\nGET /authors/yusukebe\n```\n\n```json\n{\n  \"author\": {\n    \"id\": \"yusukebe\",\n    \"name\": \"Yusuke Wada\",\n    \"url\": \"https://github.com/yusukebe\"\n  }\n}\n```\n\n## Errors\n\n### Not Found\n\nHTTP Status code is `404`.\n\nSample response:\n\n```json\n{\n  \"errors\": [\n    {\n      \"message\": \"The requested Ramen Shop 'foo' is not found\"\n    }\n  ]\n}\n```\n\n## GraphQL\n\nRamen API supports a GraphQL.\n\n![SS](https://user-images.githubusercontent.com/10682/163718911-13195ea5-c7f5-423a-bd02-fb2823f30a61.png)\n\n### Endpoint\n\n```sh\nhttps://ramen-api.dev/graphql\n```\n\n### Schemas\n\n#### Shop\n\n```graphql\ntype Shop {\n  id: String\n  name: String\n  photos: [Photo]\n}\n```\n\n#### Photo\n\n```graphql\ntype Photo {\n  name: String\n  url: String\n  width: Int\n  height: Int\n  authorId: String\n}\n```\n\n#### Author\n\n```graphql\ntype Author {\n  id: String\n  name: String\n  url: String\n}\n```\n\n### Queries\n\n#### `shop`\n\n```graphql\nquery {\n  shop(id: \"yoshimuraya\") {\n    id\n    name\n    photos {\n      name\n      width\n      height\n      url\n      authorId\n    }\n  }\n}\n```\n\n#### `shops`\n\n```graphql\nquery {\n  shops(first: 1, after: \"eW9zaGltdXJheWE=\") {\n    edges {\n      node {\n        id\n        name\n      }\n      cursor\n    }\n    pageInfo {\n      startCursor\n      endCursor\n      hasNextPage\n      hasPreviousPage\n    }\n  }\n}\n```\n\nOr you can set `last` and `before` args.\n\n```graphql\nquery {\n  shops(last: 1, before: \"eW9zaGltdXJheWE=\") {\n    pageInfo {\n      startCursor\n      endCursor\n      hasNextPage\n      hasPreviousPage\n    }\n  }\n}\n```\n\n#### `author`\n\n```graphql\nquery {\n  author(id: \"yusukebe\") {\n    id\n    name\n    url\n  }\n}\n```\n\n## Contribution\n\nYou can contribute by adding Ramen content to this project. Not only by writing code.\n\n### Adding a new shop\n\n#### 1. Fork \u0026 `clone`\n\nFork this repository and `clone` it.\n\n#### 2. Edit the author information\n\nIf this is first time, you should write about you.\n\n```sh\nmkdir ./content/authors/{authorId}\ntouch ./content/authors/{authorId}/info.json\n```\n\nEdit `./content/authors/{authorId}/info.json` like this:\n\n```javascript\n{\n  \"id\": \"yusukebe\", // \u003c-- must be /^[0-9a-zA-Z\\-\\_]+$/\n  \"name\": \"Yusuke Wada\",\n  \"url\": \"https://github.com/yusukebe\" // \u003c-- must be /^https:\\/\\/.+$/\n}\n```\n\n#### 3. Edit about the Ramen shop\n\nWrite the information of the Ramen shop which you want to add.\n\n```sh\nmkdir ./content/shops/{shopId}\ntouch ./content/shops/{shopId}/info.json\n```\n\nEdit `./content/shops/{shopId}/info.json` like this:\n\n```javascript\n{\n  \"id\": \"yoshimuraya\", // \u003c-- must be /^[0-9a-z\\-]+$/\n  \"name\": \"吉村家\",\n  \"photos\": [\n    {\n      \"name\": \"yoshimuraya-001.jpg\", // \u003c-- must be /^[0-9a-z\\-\\.]+\\.(jpg|jpeg|png|gif)$/\n      \"width\": 1200, // \u003c-- must be number\n      \"height\": 900, // \u003c-- must be number\n      \"authorId\": \"yusukebe\" // \u003c-- must be /^[0-9a-zA-Z\\-\\_]+$/\n    }\n  ]\n}\n```\n\n#### 4. Add Photo\n\nAdd your Ramen photos to an appropriate path such as `./content/shops/{shopId}/{photoName}`.\n\n```sh\ncp IMG_001.JPG ./content/shops/{shopId}/{photoName}\n```\n\n#### 5. Add `shopId` to `shops.json`\n\nAt the end, edit `./content/shops.json` to add the shop id at the last line.\n\n```javascript\n{\n  \"shopIds\": [\n    \"yoshimuraya\",\n    \"sugitaya\",\n    \"takasagoya\",\n    \"jyoujyouya\",\n    \"torakichiya\",\n    \"rasuta\",\n    \"new-shop-id\" // \u003c--- add the id at the last line\n  ]\n}\n```\n\n#### 6. Pull Request\n\nCreate Pull Request to this repository.\n\n### Notices\n\n- Do not upload a big size photo. Should be **under 300KB**.\n- An information about the shop and photos that you have been uploaded will be licensed by [Creative Commons copyright license _CC/BY_](https://creativecommons.org/licenses/by-sa/4.0/legalcode).\n\n## Tips\n\n### Resize \u0026 Optimize photos\n\nResize:\n\n```sh\nsips -Z 800 yoshimuraya-001.jpg\n```\n\nGet the image size:\n\n```sh\nsips -g pixelHeight -g pixelWidth yoshimuraya-001.jpg\n```\n\nRemove Exif and optimize the image:\n\n```sh\njpegtran -copy none -optimize -outfile yoshimuraya-001.jpg yoshimuraya-001.jpg\n```\n\n## Projects using Ramen API\n\n- [yusukebe/ramen-api-example](https://github.com/yusukebe/ramen-api-example) - An example web pages with React and Cloudflare Workers.\n- [sinyo-matu/ramen-sasshi](https://github.com/sinyo-matu/ramen-sasshi) - A web site created with Fresh2 hosted by Deno Deploy\n\n## Author\n\nYusuke Wada \u003chttps://github.com/yusukebe\u003e\n\n:heart: :ramen:\n\n## License\n\nApplication source code is distributed under the MIT license.\n\nRamen resources including the photos are distributed under the [Creative Commons copyright license _CC/BY_](https://creativecommons.org/licenses/by-sa/4.0/legalcode).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyusukebe%2Framen-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyusukebe%2Framen-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyusukebe%2Framen-api/lists"}