{"id":13639901,"url":"https://github.com/bsima/haskell-urbit-api","last_synced_at":"2025-12-11T23:16:13.488Z","repository":{"id":53622248,"uuid":"290770763","full_name":"bsima/haskell-urbit-api","owner":"bsima","description":"talk to your urbit from haskell","archived":false,"fork":false,"pushed_at":"2021-03-20T08:41:08.000Z","size":57,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-16T07:09:01.351Z","etag":null,"topics":["haskell","urbit"],"latest_commit_sha":null,"homepage":"","language":"Haskell","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/bsima.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}},"created_at":"2020-08-27T12:35:02.000Z","updated_at":"2023-05-01T07:35:23.000Z","dependencies_parsed_at":"2022-08-20T13:00:43.849Z","dependency_job_id":null,"html_url":"https://github.com/bsima/haskell-urbit-api","commit_stats":null,"previous_names":["bsima/urbit-airlock"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bsima/haskell-urbit-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsima%2Fhaskell-urbit-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsima%2Fhaskell-urbit-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsima%2Fhaskell-urbit-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsima%2Fhaskell-urbit-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bsima","download_url":"https://codeload.github.com/bsima/haskell-urbit-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bsima%2Fhaskell-urbit-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280267237,"owners_count":26301422,"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","status":"online","status_checked_at":"2025-10-21T02:00:06.614Z","response_time":58,"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":["haskell","urbit"],"created_at":"2024-08-02T01:01:05.932Z","updated_at":"2025-10-21T13:26:24.952Z","avatar_url":"https://github.com/bsima.png","language":"Haskell","funding_links":[],"categories":["Developer Tools"],"sub_categories":["HTTP APIs"],"readme":"# Haskell Urbit API\n\n[![License MIT](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT)\n[![Hackage](https://img.shields.io/hackage/v/urbit-api.svg?style=flat)](https://hackage.haskell.org/package/urbit-api)\n[![builds.sr.ht status](https://builds.sr.ht/~ben/urbit-api.svg)](https://builds.sr.ht/~ben/urbit-api?)\n[![awesome urbit badge](https://img.shields.io/badge/~-awesome%20urbit-lightgrey)](https://github.com/urbit/awesome-urbit)\n\n\n\nThis library helps you talk to your Urbit from Haskell, via HTTP.\n\nThe Urbit API is a command-query API that lets you hook into apps running on\nyour Urbit. You can submit commands (called \"pokes\") and subscribe to\nresponses.\n\nSee the `test.hs` file for some example usages.\n\n## Design\n\nThe Urbit vane `eyre` is responsible for defining the API interface. The path to\nthe API is `/~/channel/...`, where we send messages to the global log (called\n`poke`s) which are then dispatched to the appropriate apps. To receive\nresponses, we stream messages from a path associated with the app, such as\n`/mailbox/~/~zod/mc`. Internally, I believe Urbit calls these `wire`s.\n\n`urbit-api` handles most of the path, session, and HTTP request stuff\nautomatically. See the\n[haddocks](https://hackage.haskell.org/package/urbit-api/docs/Urbit-API.html)\nfor more details.\n\nThis library is built on req, conduit, and aeson, all of which are very stable\nand usable libraries for working with HTTP requests and web data.\n\n## Example usage\n\n```haskell\nimport qualified Data.Aeson as Aeson\nimport Data.Aeson ((.=))\nimport qualified Data.Text as Text\nimport qualified Data.UUID.V4 as UUID\n\nimport Urbit.API\n\nmain :: IO ()\nmain = do\n  let fakezod = Ship\n    { uid = \"0123456789abcdef\",\n      name = \"zod\",\n      lastEventId = 1,\n      url = \"http://localhost:8081\",\n      code = \"lidlut-tabwed-pillex-ridrup\"\n    }\n\n  -- Establish connection\n  sess \u003c- connect ship\n\n  -- Send a message by poking the chat-hook\n  uuid \u003c- UUID.nextRandom\n  poke sess ship \"zod\" \"chat-hook\" \"json\" $\n    Aeson.object\n      [ \"message\"\n          .= Aeson.object\n            [ \"path\" .= Text.pack \"/~/~zod/mc\",\n              \"envelope\"\n                .= Aeson.object\n                  [ \"uid\" .= UUID.toText uuid,\n                    \"number\" .= (1 :: Int),\n                    \"author\" .= Text.pack \"~zod\",\n                    \"when\" .= (1602118786225 :: Int),\n                    \"letter\" .= Aeson.object [\"text\" .= Text.pack \"hello world from haskell!\"]\n                  ]\n            ]\n      ]\n```\n\n## TODO\n\n- fix test suite on travis (OOM when trying to compile urbit)\n- more sophisticated test cases, also use cabal test instead of homegrown thing\n- add an exe that wraps the library with a cli\n- port to ghcjs\n- put some examples in the docs\n- graph store interface\n- additional agent interfaces\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbsima%2Fhaskell-urbit-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbsima%2Fhaskell-urbit-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbsima%2Fhaskell-urbit-api/lists"}