{"id":13555534,"url":"https://github.com/okdistribute/dat-rest-server","last_synced_at":"2025-10-28T03:48:06.906Z","repository":{"id":65994482,"uuid":"38078160","full_name":"okdistribute/dat-rest-server","owner":"okdistribute","description":":telescope: A robust http server for your dat","archived":false,"fork":false,"pushed_at":"2015-09-22T02:35:10.000Z","size":204,"stargazers_count":23,"open_issues_count":0,"forks_count":4,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-12-30T08:20:02.967Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/okdistribute.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":"2015-06-25T22:40:09.000Z","updated_at":"2019-08-16T04:51:23.000Z","dependencies_parsed_at":"2023-02-19T21:01:01.058Z","dependency_job_id":null,"html_url":"https://github.com/okdistribute/dat-rest-server","commit_stats":null,"previous_names":["karissa/dat-rest-server"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okdistribute%2Fdat-rest-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okdistribute%2Fdat-rest-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okdistribute%2Fdat-rest-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okdistribute%2Fdat-rest-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/okdistribute","download_url":"https://codeload.github.com/okdistribute/dat-rest-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232893302,"owners_count":18592938,"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":[],"created_at":"2024-08-01T12:03:16.168Z","updated_at":"2025-10-28T03:48:01.864Z","avatar_url":"https://github.com/okdistribute.png","language":"JavaScript","readme":"# dat-rest-server\n\nA http server for [dat](http://dat-data.com). Parameters to routes are the same as the [cli documentation](https://github.com/maxogden/dat/blob/master/docs/cli-docs.md).\n\n```\nnpm install -g dat-rest-server\ndat-rest-server --port=\u003cport\u003e --path=\u003cpath/to/dat\u003e\n```\n## GET /\n\nGets basic information about the state of the dat\n\n```\n{\n  dat: true,\n  version: \"7.0.4\",\n  status: {\n    head: \"a2c77bedfb59f2237825614b57109ef35e097f5b1bf9320e9a52ef90768d566a\",\n    transaction: false,\n    checkout: false,\n    modified: \"2015-09-01T22:53:17.775Z\",\n    datasets: 3,\n    rows: 2686,\n    files: 2,\n    versions: 4,\n    size: 1704743\n  },\n  datasets: [\n    \"organisms2\",\n    \"organisms\",\n    \"files\"\n  ]\n}\n```\n\n## POST /\n\nUsed for replication during clone:\n\n```\ndat clone mydatserver.com\n```\n\n## GET /datasets\n\n```\nGET mydatserver.com/datasets\n```\n\nReturns\n```\n[\n  \"files\",\n  \"sac-crime\",\n  \"models\"\n]\n```\n\n## GET /changes\n\nGets changes from dat\n\nOptional params: `live`\n\n```\nGET mydatserver.com/changes?live=true\n```\n\nReturns\n\n```\n{\"root\":true,\"change\":1,\"date\":\"2015-09-01T20:47:40.582Z\",\"version\":\"3ffbf6b75e57a934024c47e747390732bb0b8210310b037bb4974b5529820ea9\",\"message\":\"\",\"links\":[],\"puts\":0,\"deletes\":0,\"files\":0}\n{\"root\":false,\"change\":2,\"date\":\"2015-09-01T20:47:40.590Z\",\"version\":\"dbf404f13567d5dd727534b80816b1b95211523611410024bafb53a3831f0f18\",\"message\":\"\",\"links\":[\"3ffbf6b75e57a934024c47e747390732bb0b8210310b037bb4974b5529820ea9\"],\"puts\":1,\"deletes\":0,\"files\":1}\n{\"root\":false,\"change\":3,\"date\":\"2015-09-01T20:47:45.274Z\",\"version\":\"969be9bd7e4670633e1b8412f9617311c80b6e3aec6d6013de15b705292fcb28\",\"message\":\"\",\"links\":[\"dbf404f13567d5dd727534b80816b1b95211523611410024bafb53a3831f0f18\"],\"puts\":1342,\"deletes\":0,\"files\":0}\n{\"root\":false,\"change\":4,\"date\":\"2015-09-01T22:52:45.479Z\",\"version\":\"2e8cd3a9578e9a5281768d8a7625adc2c7e99d60660fde5a8807205240d89601\",\"message\":\"\",\"links\":[\"969be9bd7e4670633e1b8412f9617311c80b6e3aec6d6013de15b705292fcb28\"],\"puts\":1,\"deletes\":0,\"files\":1}\n{\"root\":false,\"change\":5,\"date\":\"2015-09-01T22:53:17.775Z\",\"version\":\"a2c77bedfb59f2237825614b57109ef35e097f5b1bf9320e9a52ef90768d566a\",\"message\":\"complete-\u003ecompleted\",\"links\":[\"2e8cd3a9578e9a5281768d8a7625adc2c7e99d60660fde5a8807205240d89601\"],\"puts\":1342,\"deletes\":0,\"files\":0}\n```\n\n## GET /files\n\nGet file list from dat.\n\n```\nGET mydatserver.com/files\n```\n\n```\n{\n  files: [\n    \"/Users/karissa/Dropbox/throwaway/bug.mov\",\n    \"asdf\",\n    \"black_crappie.json\",\n    \"bug.mov\",\n    \"fishing/black_crappie.json\",\n    \"fishing/yellow_perch.json\",\n    \"package.json\"\n  ]\n}\n```\n\n## GET /files/:name\n\nGet file contents with the given name\n\n```\nGET mydatserver.com/files/package.json\n```\n\n```\n{\n  name: \"Hunting-and-Fishing\",\n  publisher: \"waldoj\",\n  description: \"Hunting-and-Fishing\"\n}\n```\n\n## GET /datasets/:name\n\nGets dat data out.\n\nOptional params: `format`\n\n```\nGET mydatserver.com/datasets/\u003cdataset\u003e?format=csv\n```\n\nReturns\n```\ncdatetime,address,district,beat,grid,crimedescr,ucr_ncic_code,latitude,longitude\n1/1/06 0:00,3108 OCCIDENTAL DR,3,3C        ,1115,10851(A)VC TAKE VEH W/O OWNER,2404,38.55042047,-121.3914158\n1/1/06 0:00,2082 EXPEDITION WAY,5,5A        ,1512,459 PC  BURGLARY RESIDENCE,2204,38.47350069,-121.4901858\n1/1/06 0:00,4 PALEN CT,2,2A        ,212,10851(A)VC TAKE VEH W/O OWNER,2404,38.65784584,-121.4621009\n1/1/06 0:00,22 BECKFORD CT,6,6C        ,1443,476 PC PASS FICTICIOUS CHECK,2501,38.50677377,-121.4269508\n1/1/06 0:00,3421 AUBURN BLVD,2,2A        ,508,459 PC  BURGLARY-UNSPECIFIED,2299,38.6374478,-121.3846125\n1/1/06 0:00,5301 BONNIEMAE WAY,6,6B        ,1084,530.5 PC USE PERSONAL ID INFO,2604,38.52697863,-121.4513383\n1/1/06 0:00,2217 16TH AVE,4,4A        ,957,459 PC  BURGLARY VEHICLE,2299,38.537173,-121.4875774\n1/1/06 0:00,3547 P ST,3,3C        ,853,484 PC   PETTY THEFT/INSIDE,2308,38.56433456,-121.4618826\n1/1/06 0:00,3421 AUBURN BLVD,2,2A        ,508,459 PC  BURGLARY BUSINESS,2203,38.6374478,-121.3846125\n1/1/06 0:00,1326 HELMSMAN WAY,1,1B        ,444,1708 US   THEFT OF MAIL,2310,38.60960217,-121.4918375\n```\n\n\n## POST /datasets/:dataset\n\nPut data in dat.\n\nOptional params: `message`, `format`, `key`.\n\n```\nPOST mydatserver.com/datasets/\u003cdataset\u003e\n```\n\nBe sure to push data in the request with an appropriate `Content-Type` header:\n\n```\n'json': 'application/json',\n'csv': 'text/csv',\n'ndjson': 'application/x-ndjson',\n'sse': 'text/event-stream'\n```\n\n","funding_links":[],"categories":["JavaScript","others"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fokdistribute%2Fdat-rest-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fokdistribute%2Fdat-rest-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fokdistribute%2Fdat-rest-server/lists"}