{"id":29138107,"url":"https://github.com/eastsun5566/hackmd-api-client-rs","last_synced_at":"2026-03-06T06:02:40.095Z","repository":{"id":295589200,"uuid":"677084038","full_name":"EastSun5566/hackmd-api-client-rs","owner":"EastSun5566","description":"🦀📝 A HackMD Rust API client for rustacean \u0026 friends","archived":false,"fork":false,"pushed_at":"2026-02-01T16:02:54.000Z","size":38,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-02T01:11:10.623Z","etag":null,"topics":["api","client","hackmd","mardown","sdk"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/hackmd-api-client-rs","language":"Rust","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/EastSun5566.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":"2023-08-10T17:40:39.000Z","updated_at":"2025-05-27T09:04:51.000Z","dependencies_parsed_at":"2025-05-29T14:03:24.438Z","dependency_job_id":null,"html_url":"https://github.com/EastSun5566/hackmd-api-client-rs","commit_stats":null,"previous_names":["eastsun5566/hackmd-api-client-rs"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/EastSun5566/hackmd-api-client-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EastSun5566%2Fhackmd-api-client-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EastSun5566%2Fhackmd-api-client-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EastSun5566%2Fhackmd-api-client-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EastSun5566%2Fhackmd-api-client-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EastSun5566","download_url":"https://codeload.github.com/EastSun5566/hackmd-api-client-rs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EastSun5566%2Fhackmd-api-client-rs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30164532,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T04:43:31.446Z","status":"ssl_error","status_checked_at":"2026-03-06T04:40:30.133Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["api","client","hackmd","mardown","sdk"],"created_at":"2025-06-30T13:05:15.835Z","updated_at":"2026-03-06T06:02:40.064Z","avatar_url":"https://github.com/EastSun5566.png","language":"Rust","readme":"# HackMD Rust API Client\n\n[![crates.io](https://img.shields.io/crates/v/hackmd-api-client-rs.svg?style=for-the-badge)](https://crates.io/crates/hackmd-api-client-rs)\n[![docs](https://img.shields.io/docsrs/hackmd-api-client-rs?style=for-the-badge)](https://docs.rs/hackmd-api-client-rs)\n\n\u003e 🦀📝 A Rust client library for the [HackMD API](https://hackmd.io/@docs/HackMD_API_Book).\n\nYou can sign up for an account at [hackmd.io](https://hackmd.io/), and then create access tokens by following the [developer portal](https://hackmd.io/@hackmd-api/developer-portal).\n\n## Features\n\n- ✅ Complete API coverage (User, Notes, Teams)\n- ✅ Async/await support with `tokio`\n- ✅ Retry mechanism with exponential backoff\n- ✅ Comprehensive error handling \u0026 Type-safe request/response\n\n## Installation\n\n```bash\ncargo add hackmd-api-client-rs\n```\n\n## Quick Start\n\n```rust\nuse hackmd_api_client_rs::{ApiClient, ApiClientOptions};\nuse hackmd_api_client_rs::types::CreateNoteOptions;\n\n#[tokio::main]\nasync fn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    // Create API client\n    let client = ApiClient::new(\n        \"\u003cYOUR_ACCESS_TOKEN\u003e\",\n        None, // Use default API endpoint\n        Some(ApiClientOptions::default()),\n    )?;\n\n    // Get user information\n    let user = client.get_me().await?;\n    println!(\"User: {} ({})\", user.name, user.email.unwrap_or_default());\n\n    // Create a new note\n    let note_options = CreateNoteOptions {\n        title: Some(\"My First Note\".to_string()),\n        content: Some(\"# Hello World\\\\n\\\\nThis is my first note!\".to_string()),\n        read_permission: None,\n        write_permission: None,\n        comment_permission: None,\n        permalink: None,\n    };\n\n    let note = client.create_note(\u0026note_options).await?;\n    println!(\"Created note: {} (ID: {})\", note.note.title, note.note.id);\n\n    Ok(())\n}\n```\n\n## Configuration\n\nYou can customize the client behavior with `ApiClientOptions`:\n\n```rust\nuse hackmd_api_client_rs::{ApiClient, ApiClientOptions, RetryOptions};\nuse std::time::Duration;\n\nlet options = ApiClientOptions {\n    wrap_response_errors: true, // Convert HTTP errors to custom error types\n    timeout: Some(Duration::from_secs(30)), // Request timeout\n    retry_options: Some(RetryOptions {\n        max_retries: 3,\n        base_delay: Duration::from_millis(100),\n    }),\n};\n\nlet client = ApiClient::new(\"\u003cYOUR_ACCESS_TOKEN\u003e\", None, Some(options))?;\n```\n\n## API Methods\n\n### User API\n\n- `get_me()` - Get current user information\n- `get_history()` - Get user's note history\n- `get_note_list()` - Get user's notes\n- `get_note(note_id)` - Get a specific note\n- `create_note(options)` - Create a new note\n- `update_note(note_id, options)` - Update a note\n- `update_note_content(note_id, content)` - Update note content only\n- `delete_note(note_id)` - Delete a note\n\n### Team API\n\n- `get_teams()` - Get user's teams\n- `get_team_notes(team_path)` - Get team's notes\n- `create_team_note(team_path, options)` - Create a team note\n- `update_team_note(team_path, note_id, options)` - Update a team note\n- `update_team_note_content(team_path, note_id, content)` - Update team note content\n- `delete_team_note(team_path, note_id)` - Delete a team note\n\n## Error Handling\n\nThe client provides comprehensive error handling with custom error types:\n\n```rust\nuse hackmd_api_client_rs::error::ApiError;\n\nmatch client.get_me().await {\n    Ok(user) =\u003e println!(\"User: {}\", user.name),\n    Err(ApiError::TooManyRequests(err)) =\u003e {\n        println!(\"Rate limited: {}/{} requests remaining\",\n                err.user_remaining, err.user_limit);\n    },\n    Err(ApiError::InternalServer(err)) =\u003e {\n        println!(\"Server error: {}\", err.message);\n    },\n    Err(err) =\u003e println!(\"Other error: {}\", err),\n}\n```\n\n## Examples\n\nRun the basic usage example:\n\n```bash\ncargo run --example basic_usage\n```\n\n\u003e [!NOTE]\n\u003e Make sure to set your HackMD access token in the example code before running.\n\nadvanced usage example:\n\n```bash\ncargo run --example advanced_usage\n```\n\n## Types\n\nAll API types are available in the `types` module:\n\n- `User` - User information\n- `Team` - Team information\n- `Note` - Note metadata\n- `SingleNote` - Note with content\n- `CreateNoteOptions` - Options for creating notes\n- `UpdateNoteOptions` - Options for updating notes\n- Various enums for permissions and visibility\n\n## License\n\nMIT License\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feastsun5566%2Fhackmd-api-client-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feastsun5566%2Fhackmd-api-client-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feastsun5566%2Fhackmd-api-client-rs/lists"}