{"id":38158128,"url":"https://github.com/sklinkert/ghost","last_synced_at":"2026-01-16T23:12:42.739Z","repository":{"id":264839932,"uuid":"344845544","full_name":"sklinkert/ghost","owner":"sklinkert","description":"Unofficial Ghost CMS API Client in Go/Golang.","archived":false,"fork":false,"pushed_at":"2025-11-30T10:56:27.000Z","size":93,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-02T00:05:44.965Z","etag":null,"topics":["api","blog","ghost","ghost-cms","go","golang"],"latest_commit_sha":null,"homepage":"https://ghost.org/docs","language":"Go","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/sklinkert.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":"2021-03-05T15:03:35.000Z","updated_at":"2025-11-30T10:56:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"2c477a1b-ce76-4f7d-9ba9-768841c1cd3d","html_url":"https://github.com/sklinkert/ghost","commit_stats":null,"previous_names":["sklinkert/ghost"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sklinkert/ghost","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sklinkert%2Fghost","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sklinkert%2Fghost/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sklinkert%2Fghost/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sklinkert%2Fghost/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sklinkert","download_url":"https://codeload.github.com/sklinkert/ghost/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sklinkert%2Fghost/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28487340,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T22:54:02.790Z","status":"ssl_error","status_checked_at":"2026-01-16T22:50:10.344Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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","blog","ghost","ghost-cms","go","golang"],"created_at":"2026-01-16T23:12:42.549Z","updated_at":"2026-01-16T23:12:42.718Z","avatar_url":"https://github.com/sklinkert.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Unofficial Go Client for Ghost Blogs\n\nNot affiliated in any way with Ghost.org.\n\n[Ghost](https://ghost.org/) Client (ContentAPI + AdminAPI)\n\n## Installation\n\n```bash\ngo get github.com/sklinkert/ghost\n```\n\n## Supported features\n\n### Posts\n* [x] Get posts (Content API + Admin API)\n* [x] Get post by ID\n* [x] Get posts by tag\n* [x] Add post\n* [x] Update post\n* [x] Delete post\n* [x] Search posts\n\n### Pages\n* [x] Get pages (Content API + Admin API)\n* [x] Get page by ID\n* [x] Add page\n* [x] Update page\n* [x] Delete page\n\n### Tags\n* [x] Get tags\n* [x] Add tags\n* [x] Update tag\n* [x] Delete tag\n\n### Members\n* [x] Get members (with pagination)\n* [x] Get member by ID\n* [x] Add member\n* [x] Delete member\n\n### Images\n* [x] Upload image\n\n## Usage\n\n### Initialization\n\n```go\npackage main\n\nimport (\n\t\"github.com/sklinkert/ghost\"\n\t\"net/http\"\n\t\"time\"\n)\n\nfunc main() {\n\tcontentAPIToken := \"837484...\"\n\tadminAPIToken := \"90968696...\"\n\n\t// Default usage\n\tghostAPI := ghost.New(\"https://example.com\", contentAPIToken, adminAPIToken)\n\n\t// With custom HTTP client\n\tcustomClient := \u0026http.Client{\n\t\tTimeout: 30 * time.Second,\n\t}\n\tghostAPI = ghost.New(\"https://example.com\", contentAPIToken, adminAPIToken, customClient)\n}\n```\n\n### Posts\n\n```go\n// Get all posts (Content API)\nposts, err := ghostAPI.GetPosts()\n\n// Get all posts (Admin API)\nposts, err := ghostAPI.AdminGetPosts()\n\n// Get post by ID\nposts, err := ghostAPI.AdminGetPost(\"628f557f0a8ce9486eb37623\")\n\n// Get posts by tag\nposts, err := ghostAPI.AdminGetPostsByTag(\"news\")\n\n// Search posts\nposts, err := ghostAPI.AdminSearchPosts(\"search query\")\n\n// Create a new post\nnewPost := ghost.Post{\n\tTitle:  \"My New Post\",\n\tHTML:   \"\u003cp\u003ePost content here\u003c/p\u003e\",\n\tStatus: ghost.StatusPublished,\n}\nposts, err := ghostAPI.AdminCreatePost(newPost)\n\n// Update a post\npost.Title = \"Updated Title\"\nerr := ghostAPI.AdminUpdatePost(post, ghost.SourceHTML)\n\n// Delete a post\nerr := ghostAPI.AdminDeletePost(\"628f557f0a8ce9486eb37623\")\n```\n\n### Pages\n\n```go\n// Get all pages (Content API)\npages, err := ghostAPI.GetPages()\n\n// Get all pages (Admin API)\npages, err := ghostAPI.AdminGetPages()\n\n// Get page by ID\npages, err := ghostAPI.AdminGetPage(\"628f557f0a8ce9486eb37623\")\n\n// Create a new page\nnewPage := ghost.Page{\n\tTitle:  \"My New Page\",\n\tHTML:   \"\u003cp\u003ePage content here\u003c/p\u003e\",\n\tStatus: ghost.StatusPublished,\n}\npages, err := ghostAPI.AdminCreatePage(newPage)\n\n// Update a page\npage.Title = \"Updated Title\"\nerr := ghostAPI.AdminUpdatePage(page, ghost.SourceHTML)\n\n// Delete a page\nerr := ghostAPI.AdminDeletePage(\"628f557f0a8ce9486eb37623\")\n```\n\n### Tags\n\n```go\n// Get all tags\ntags, err := ghostAPI.AdminGetTags()\n\n// Create new tags\nnewTags := ghost.NewTags{\n\tTags: []ghost.NewTag{\n\t\t{Name: \"Technology\", Slug: \"technology\"},\n\t\t{Name: \"News\", Slug: \"news\"},\n\t},\n}\nerr := ghostAPI.AdminCreateTags(newTags)\n\n// Update a tag\ntag.Name = \"Updated Name\"\nerr := ghostAPI.AdminUpdateTag(tag)\n\n// Delete a tag\nerr := ghostAPI.AdminDeleteTag(tag)\n```\n\n### Members\n\n```go\n// Get all members (with automatic pagination)\nmembers, err := ghostAPI.AdminGetMembers()\n\n// Get member by ID\nmembers, err := ghostAPI.AdminGetMember(\"691ca681b7c6ec3a01a2ba81\")\nif err == nil \u0026\u0026 len(members.Members) \u003e 0 {\n\tmember := members.Members[0]\n\tfmt.Printf(\"Member: %s (%s)\\n\", member.Name, member.Email)\n}\n\n// Create a new member\nnewMember := ghost.NewMember{\n\tName:  \"John Doe\",\n\tEmail: \"john@example.com\",\n}\nmembers, err := ghostAPI.AdminCreateMember(newMember)\n\n// Delete a member\nerr := ghostAPI.AdminDeleteMember(\"691ca681b7c6ec3a01a2ba81\")\n```\n\n### Images\n\n```go\n// Upload an image\nimageURL, err := ghostAPI.AdminUploadImage(\"./myimage.jpg\")\nif err != nil {\n\tfmt.Printf(\"Image upload failed: %v\\n\", err)\n}\nfmt.Println(imageURL)\n```\n\n## API Reference\n\n### Client Initialization\n\n```go\nfunc New(url, contentAPIToken, adminAPIToken string, client ...*http.Client) *Ghost\n```\n\n### Posts\n\n| Method | Description |\n|--------|-------------|\n| `GetPosts()` | Get all posts via Content API |\n| `GetPost(postId)` | Get a single post via Content API |\n| `GetPostsByTag(tag)` | Get posts by tag via Content API |\n| `AdminGetPosts()` | Get all posts via Admin API |\n| `AdminGetPost(postId)` | Get a single post via Admin API |\n| `AdminGetPostsByTag(tag)` | Get posts by tag via Admin API |\n| `AdminCreatePost(post)` | Create a new post |\n| `AdminUpdatePost(post, sourceType)` | Update an existing post |\n| `AdminDeletePost(postId)` | Delete a post |\n| `AdminSearchPosts(query)` | Search posts by title or excerpt |\n\n### Pages\n\n| Method | Description |\n|--------|-------------|\n| `GetPages()` | Get all pages via Content API |\n| `AdminGetPages()` | Get all pages via Admin API |\n| `AdminGetPage(pageId)` | Get a single page via Admin API |\n| `AdminCreatePage(page)` | Create a new page |\n| `AdminUpdatePage(page, sourceType)` | Update an existing page |\n| `AdminDeletePage(pageId)` | Delete a page |\n\n### Tags\n\n| Method | Description |\n|--------|-------------|\n| `AdminGetTags()` | Get all tags (with pagination) |\n| `AdminCreateTags(tags)` | Create new tags |\n| `AdminUpdateTag(tag)` | Update an existing tag |\n| `AdminDeleteTag(tag)` | Delete a tag |\n\n### Members\n\n| Method | Description |\n|--------|-------------|\n| `AdminGetMembers()` | Get all members (with pagination) |\n| `AdminGetMember(memberId)` | Get a single member by ID |\n| `AdminCreateMember(member)` | Create a new member |\n| `AdminDeleteMember(memberId)` | Delete a member |\n\n### Images\n\n| Method | Description |\n|--------|-------------|\n| `AdminUploadImage(path)` | Upload an image file |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsklinkert%2Fghost","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsklinkert%2Fghost","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsklinkert%2Fghost/lists"}