{"id":47748198,"url":"https://github.com/evex-dev/cookpad-rust","last_synced_at":"2026-04-03T02:01:20.326Z","repository":{"id":347611358,"uuid":"1194643763","full_name":"evex-dev/cookpad-rust","owner":"evex-dev","description":null,"archived":false,"fork":false,"pushed_at":"2026-03-28T16:23:35.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-28T18:26:59.519Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/evex-dev.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-28T16:22:31.000Z","updated_at":"2026-03-28T16:23:38.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/evex-dev/cookpad-rust","commit_stats":null,"previous_names":["evex-dev/cookpad-rust"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/evex-dev/cookpad-rust","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evex-dev%2Fcookpad-rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evex-dev%2Fcookpad-rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evex-dev%2Fcookpad-rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evex-dev%2Fcookpad-rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/evex-dev","download_url":"https://codeload.github.com/evex-dev/cookpad-rust/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evex-dev%2Fcookpad-rust/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31326842,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-03T01:42:14.489Z","status":"online","status_checked_at":"2026-04-03T02:00:06.642Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2026-04-03T02:00:37.589Z","updated_at":"2026-04-03T02:01:20.318Z","avatar_url":"https://github.com/evex-dev.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cookpad-rs\n\nCookpad の非公式 Rust クライアント。\ncookpad-py を Rust にリライトした。\n\n## インストール\n\n`Cargo.toml` に追加:\n\n```toml\n[dependencies]\ncookpad = { git = \"https://github.com/evex-dev/cookpad-rs\" }\n```\n\n## 使い方\n\n一部の引数とかは、認証済みの token じゃないと動かないので注意\n\n```rust\nuse cookpad::Cookpad;\n\n#[tokio::main]\nasync fn main() -\u003e Result\u003c(), cookpad::CookpadError\u003e {\n    let client = Cookpad::new();\n\n    // レシピ検索\n    let results = client.search_recipes(\"カレー\").await?;\n    for recipe in \u0026results.recipes {\n        println!(\"{} (つくれぽ: {})\", recipe.title, recipe.cooksnaps_count);\n    }\n\n    // レシピ詳細\n    let recipe = client.get_recipe(25410768).await?;\n    println!(\"{}\", recipe.title);\n    for step in \u0026recipe.steps {\n        println!(\"  - {}\", step.description);\n    }\n\n    Ok(())\n}\n```\n\n## API\n\n### `Cookpad::new()`\n\nクライアント作成。デフォルトで anonymous token 使うからそのまま動く。\n\n```rust\n// デフォルト (日本語・匿名)\nlet client = Cookpad::new();\n\n// カスタム\nlet client = Cookpad::with_config(\n    \"your_token\",\n    \"JP\",\n    \"ja\",\n    \"Asia/Tokyo\",\n    \"+09:00\",\n    \"custom/1.0\",\n    \"8\",\n);\n```\n\n### `search_recipes(query)` / `search_recipes_with_options(query, page, per_page)`\n\nレシピ検索。`SearchResponse` を返す。\n\n```rust\nlet results = client.search_recipes(\"鶏むね肉\").await?;\nprintln!(\"全 {} 件\", results.total_count);\nfor recipe in \u0026results.recipes {\n    println!(\"  {}\", recipe.title);\n}\n\n// 次のページ\nif let Some(next) = results.next_page {\n    let page2 = client.search_recipes_with_options(\"鶏むね肉\", next as u32, 30).await?;\n}\n```\n\n### `get_recipe(recipe_id)`\n\nレシピ詳細を取得。`Recipe` を返す。\n\n```rust\nlet recipe = client.get_recipe(25410768).await?;\nprintln!(\"{}\", recipe.title);\nprintln!(\"{}\", recipe.story);\nprintln!(\"材料 ({}):\", recipe.serving);\nfor ing in \u0026recipe.ingredients {\n    println!(\"  {}: {}\", ing.name, ing.quantity);\n}\nfor step in \u0026recipe.steps {\n    println!(\"  {}\", step.description);\n}\n```\n\n### `get_similar_recipes(recipe_id, page, per_page)`\n\n似てるレシピ一覧。\n\n```rust\nlet similar = client.get_similar_recipes(25410768, 1, 30).await?;\nfor recipe in \u0026similar {\n    println!(\"{}\", recipe.title);\n}\n```\n\n### `get_comments(recipe_id, limit, after, label)`\n\nつくれぽ・コメント取得。\n\n```rust\nlet comments = client.get_comments(18510866, 10, \"\", \"cooksnap\").await?;\nfor comment in \u0026comments.comments {\n    if let Some(user) = \u0026comment.user {\n        println!(\"{}: {}\", user.name, comment.body);\n    }\n}\n\n// ページネーション (カーソルベース)\nif let Some(cursor) = \u0026comments.next_cursor {\n    let more = client.get_comments(18510866, 10, cursor, \"cooksnap\").await?;\n}\n```\n\n### `search_users(query, page, per_page)`\n\nユーザー検索。\n\n```rust\nlet users = client.search_users(\"test\", 1, 20).await?;\nfor user in \u0026users.users {\n    println!(\"{} (レシピ数: {})\", user.name, user.recipe_count);\n}\n```\n\n### `search_keywords(query)`\n\n検索サジェスト。\n\n```rust\nlet suggestions = client.search_keywords(\"カレ\").await?;\n```\n\n### `get_search_history(local_history)`\n\n検索履歴・トレンドキーワード。\n\n```rust\nlet history = client.get_search_history(\u0026[]).await?;\n```\n\n## 型\n\nレスポンスは全部 struct でパース済み。`serde::Serialize` も実装してるので JSON に戻せる。\n\n- `Recipe` - レシピ (id, title, story, serving, ingredients, steps, ...)\n- `Ingredient` - 材料 (name, quantity)\n- `Step` - 手順 (description, image_url)\n- `User` - ユーザー (id, name, recipe_count, ...)\n- `Comment` - コメント/つくれぽ (body, user, image_url, ...)\n- `Image` - 画像 (url, filename, alt_text)\n- `SearchResponse` - 検索結果 (recipes, total_count, next_page)\n- `CommentsResponse` - コメント一覧 (comments, next_cursor)\n- `UsersResponse` - ユーザー一覧 (users, total_count, next_page)\n\n## エラー\n\n```rust\nuse cookpad::CookpadError;\n\nmatch client.get_recipe(99999999).await {\n    Ok(recipe) =\u003e println!(\"{}\", recipe.title),\n    Err(CookpadError::NotFoundError(_)) =\u003e println!(\"レシピが見つからない\"),\n    Err(CookpadError::RateLimitError)   =\u003e println!(\"レート制限\"),\n    Err(e) =\u003e println!(\"なんかエラー: {}\", e),\n}\n```\n\n## ライセンス\n\nThe Unlicense (パブリックドメイン)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevex-dev%2Fcookpad-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevex-dev%2Fcookpad-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevex-dev%2Fcookpad-rust/lists"}