{"__v":6,"_id":"5537e1f63e785d0d00be3feb","category":{"__v":7,"_id":"542ac32254d88d140075fc3a","pages":["542ac32254d88d140075fc3c","55369f1f6fd3c40d00334978","5537e1563faac70d00ff6da6","5537e1f63e785d0d00be3feb","5537e22249a5800d00a28e54","5537e24b3faac70d00ff6da8","5537e26349a5800d00a28e56"],"project":"542ac32254d88d140075fc36","version":"542ac32254d88d140075fc39","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-09-30T14:50:10.530Z","from_sync":false,"order":0,"slug":"documentation","title":"Documentation"},"project":"542ac32254d88d140075fc36","user":"542ac2d054d88d140075fc29","version":{"__v":4,"_id":"542ac32254d88d140075fc39","project":"542ac32254d88d140075fc36","createdAt":"2014-09-30T14:50:10.500Z","releaseDate":"2014-09-30T14:50:10.500Z","categories":["542ac32254d88d140075fc3a","542af0fd54d88d140075ff1b","542af128cedcfc140004b8d0","5537e2870899730d0081368d"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-04-22T18:01:26.491Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":5,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"GET metadata/:dataset\"\n}\n[/block]\nReturns the metadata for a dataset, including the description, who owns it, any parent datasets on Exversion and interesting statistics.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"parameter\",\n    \"h-1\": \"value\",\n    \"0-0\": \"key\",\n    \"0-1\": \"Your API keu\"\n  },\n  \"cols\": 2,\n  \"rows\": 1\n}\n[/block]\n**Example Requests**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"import requests\\n\\nr = requests.get(\\\"https://www.exversion.com/api/v1/metadata/[DATASET ID]?key=[YOUR API KEY]\\\")\",\n      \"language\": \"python\"\n    },\n    {\n      \"code\": \"<?php\\n\\t$ch = curl_init('https://www.exversion.com/api/v1/metadata/[DATASET ID]?key=[YOUR API KEY]');\\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\\n$result = json_decode(curl_exec($ch));\\n?>\",\n      \"language\": \"php\"\n    },\n    {\n      \"code\": \"require 'unirest'\\nresponse = Unirest.get \\\"https://www.exversion.com/api/v1/metadata/[DATASET ID]?key=[YOUR API KEY]\\\"\",\n      \"language\": \"ruby\"\n    }\n  ]\n}\n[/block]\n**Example Response**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\\"status\\\":200,\\n \\\"message\\\":\\\"Success\\\",\\n \\\"body\\\":[\\n   {\\\"dataset\\\":\\\"A9G8JOU2O95IPY2\\\",\\n    \\\"sourceURL\\\":\\\"https:\\\\/\\\\/data.sfgov.org\\\\/Arts-Culture-and-Recreation-\\\\/Film-Locations-in-San-Francisco\\\\/yitu-d5am\\\",\\n    \\\"sourceAuthor\\\":\\\"Lauren Machado\\\",\\n    \\\"sourceDate\\\":\\\"Nov 10, 2011\\\",\\n    \\\"sourceContact\\\":\\\"N\\\\/A\\\",\\n    \\\"uploadedBy\\\":{\\\"id\\\":1,\\\"name\\\":\\\"bellmar\\\"},\\n    \\\"description\\\":\\\"If you love movies, and you love San Francisco, you're bound to love this -- a listing of filming locations of movies shot in San Francisco from 1924 - 2010. You'll find the titles, locations, fun facts, names of the director, writer, actors, and studio for most of these films.\\\",\\n    \\\"heritage\\\":[],\\n    \\\"size\\\":193208,\\n    \\\"forkchanges\\\":null\\n   }\\n ]\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"GET count/:dataset\"\n}\n[/block]\nRuns a query on the selected dataset and calculates the number of rows that will be returned. Accepts the same parameters as a normal query.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"parameter\",\n    \"h-1\": \"value\",\n    \"0-0\": \"key\",\n    \"0-1\": \"Your API key\",\n    \"1-0\": \"[column_name]\",\n    \"1-1\": \"Will return only rows where the value of this column matches\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n**Example Requests**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"import requests\\n\\nr = requests.get(\\\"https://www.exversion.com/api/v1/count/[DATASET ID]?key=[YOUR API KEY]&last_name=Foo\\\")\",\n      \"language\": \"python\"\n    },\n    {\n      \"code\": \"<?php\\n\\t$ch = curl_init('https://www.exversion.com/api/v1/count/[DATASET ID]?key=[YOUR API KEY]&last_name=Foo');\\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\\n$result = json_decode(curl_exec($ch));\\n?>\",\n      \"language\": \"php\"\n    },\n    {\n      \"code\": \"require 'unirest'\\nresponse = Unirest.get \\\"https://www.exversion.com/api/v1/count/[DATASET ID]?key=[YOUR API KEY]&last_name=Foo\\\"\",\n      \"language\": \"ruby\"\n    }\n  ]\n}\n[/block]\n**Example Response**\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\\"status\\\":200,\\n \\\"message\\\":\\\"Success\\\",\\n \\\"body\\\":[\\n   {\\\"count\\\" : 30},\\n ]\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"dataset-metadata","type":"basic","title":"Dataset Metadata"}
[block:api-header] { "type": "basic", "title": "GET metadata/:dataset" } [/block] Returns the metadata for a dataset, including the description, who owns it, any parent datasets on Exversion and interesting statistics. [block:parameters] { "data": { "h-0": "parameter", "h-1": "value", "0-0": "key", "0-1": "Your API keu" }, "cols": 2, "rows": 1 } [/block] **Example Requests** [block:code] { "codes": [ { "code": "import requests\n\nr = requests.get(\"https://www.exversion.com/api/v1/metadata/[DATASET ID]?key=[YOUR API KEY]\")", "language": "python" }, { "code": "<?php\n\t$ch = curl_init('https://www.exversion.com/api/v1/metadata/[DATASET ID]?key=[YOUR API KEY]');\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n$result = json_decode(curl_exec($ch));\n?>", "language": "php" }, { "code": "require 'unirest'\nresponse = Unirest.get \"https://www.exversion.com/api/v1/metadata/[DATASET ID]?key=[YOUR API KEY]\"", "language": "ruby" } ] } [/block] **Example Response** [block:code] { "codes": [ { "code": "{\"status\":200,\n \"message\":\"Success\",\n \"body\":[\n {\"dataset\":\"A9G8JOU2O95IPY2\",\n \"sourceURL\":\"https:\\/\\/data.sfgov.org\\/Arts-Culture-and-Recreation-\\/Film-Locations-in-San-Francisco\\/yitu-d5am\",\n \"sourceAuthor\":\"Lauren Machado\",\n \"sourceDate\":\"Nov 10, 2011\",\n \"sourceContact\":\"N\\/A\",\n \"uploadedBy\":{\"id\":1,\"name\":\"bellmar\"},\n \"description\":\"If you love movies, and you love San Francisco, you're bound to love this -- a listing of filming locations of movies shot in San Francisco from 1924 - 2010. You'll find the titles, locations, fun facts, names of the director, writer, actors, and studio for most of these films.\",\n \"heritage\":[],\n \"size\":193208,\n \"forkchanges\":null\n }\n ]\n}", "language": "json" } ] } [/block] [block:api-header] { "type": "basic", "title": "GET count/:dataset" } [/block] Runs a query on the selected dataset and calculates the number of rows that will be returned. Accepts the same parameters as a normal query. [block:parameters] { "data": { "h-0": "parameter", "h-1": "value", "0-0": "key", "0-1": "Your API key", "1-0": "[column_name]", "1-1": "Will return only rows where the value of this column matches" }, "cols": 2, "rows": 2 } [/block] **Example Requests** [block:code] { "codes": [ { "code": "import requests\n\nr = requests.get(\"https://www.exversion.com/api/v1/count/[DATASET ID]?key=[YOUR API KEY]&last_name=Foo\")", "language": "python" }, { "code": "<?php\n\t$ch = curl_init('https://www.exversion.com/api/v1/count/[DATASET ID]?key=[YOUR API KEY]&last_name=Foo');\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n$result = json_decode(curl_exec($ch));\n?>", "language": "php" }, { "code": "require 'unirest'\nresponse = Unirest.get \"https://www.exversion.com/api/v1/count/[DATASET ID]?key=[YOUR API KEY]&last_name=Foo\"", "language": "ruby" } ] } [/block] **Example Response** [block:code] { "codes": [ { "code": "{\"status\":200,\n \"message\":\"Success\",\n \"body\":[\n {\"count\" : 30},\n ]\n}", "language": "json" } ] } [/block]