{"__v":1,"_id":"55fac407bc972f0d0005f644","category":{"__v":21,"_id":"55a7aee94a33f92b00b7a154","pages":["55a7aee94a33f92b00b7a156","55a7ea403efe0c2f0074cb75","55a80eb23ec2ec0d00bd66ea","55a811fc6e61e619004f703e","55a8c513cf45e1390093f18c","55a8d9fa27a17d210052516d","55a8f048cf45e1390093f248","55aba4ba63a6b60d006616e1","55abab0a0685ce0d0049fb8d","55abb04da36ccd0d00fdebc1","55abc1cc63a6b60d006616f4","55abcdbd63a6b60d006616fa","55abd36763a6b60d00661700","55abd50ea36ccd0d00fdebdb","55abd8c3a36ccd0d00fdebdf","55abd9cc0685ce0d0049fbb5","55abdb6b63a6b60d00661706","55abdc9b0685ce0d0049fbb8","55c1f5fca131980d005be95b","55fac407bc972f0d0005f644","569f68e766a5640d00efa52d"],"project":"55a7aee84a33f92b00b7a150","version":"55a7aee84a33f92b00b7a153","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-07-16T13:17:29.102Z","from_sync":false,"order":2,"slug":"endpoints","title":"Endpoints"},"editedParams":true,"editedParams2":true,"parentDoc":null,"project":"55a7aee84a33f92b00b7a150","user":"55a7c77b4a33f92b00b7a1a9","version":{"__v":6,"_id":"55a7aee84a33f92b00b7a153","project":"55a7aee84a33f92b00b7a150","createdAt":"2015-07-16T13:17:28.411Z","releaseDate":"2015-07-16T13:17:28.411Z","categories":["55a7aee94a33f92b00b7a154","55a7fefa3efe0c2f0074cbdf","55a8fb10c8bd450d000dd130","55a936b1cf45e1390093f362","55abddeaa36ccd0d00fdebe1","5624db675a86b423009462e1"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":["563a310d1846790d00895325"],"next":{"pages":[],"description":""},"createdAt":"2015-09-17T13:45:43.782Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"code":"curl https://api.aylien.com/api/v1/classify/iab-qag \\\n   -H \"X-AYLIEN-TextAPI-Application-Key: [[app:key]]\" \\\n   -H \"X-AYLIEN-TextAPI-Application-ID: [[app:id]]\" \\\n   -d \"url=http://techcrunch.com/2015/07/16/microsoft-will-never-give-up-on-mobile\"","language":"curl"},{"code":"textapi.classifyByTaxonomy({\n  'url': 'http://techcrunch.com/2015/07/16/microsoft-will-never-give-up-on-mobile',\n  'taxonomy': 'iab-qag'\n}, function(error, response) {\n  if (error === null) {\n    response['categories'].forEach(function(c) {\n      console.log(c);\n    });\n  }\n});","language":"javascript"},{"code":"url = \"http://techcrunch.com/2015/07/16/microsoft-will-never-give-up-on-mobile\"\nclassifications = client.ClassifyByTaxonomy({\"url\": url, \"taxonomy\": \"iab-qag\"})\nfor category in classifications['categories']:\n  print category","language":"python"},{"code":"<?php\n$url = 'http://techcrunch.com/2015/07/16/microsoft-will-never-give-up-on-mobile';\n$classifications = $textapi->ClassifyByTaxonomy(array(\"url\" => $url, \"taxonomy\" => \"iab-qag\"));\nforeach($classifications->categories as $category) {\n  var_dump($category);\n}\n?>","language":"php"},{"code":"ClassifyByTaxonomyParams.Builder builder = ClassifyByTaxonomyParams.newBuilder();\nURL url = new URL(\"http://techcrunch.com/2015/07/16/microsoft-will-never-give-up-on-mobile\");\nbuilder.setUrl(url);\nbuilder.setTaxonomy(ClassifyByTaxonomyParams.StandardTaxonomy.IAB_QAG);\nTaxonomyClassifications response = client.classifyByTaxonomy(builder.build());\nfor (TaxonomyCategory c: response.getCategories()) {\n  System.out.println(c);\n}","language":"java"},{"code":"url = \"http://techcrunch.com/2015/07/16/microsoft-will-never-give-up-on-mobile\"\n\nresponse = client.classify_by_taxonomy url: url, taxonomy: \"iab-qag\"\n\nputs response[:categories].map {|c| c[:label]}.join(', ')","language":"ruby"},{"code":"url := \"http://techcrunch.com/2015/07/16/microsoft-will-never-give-up-on-mobile\"\nparams := &textapi.ClassifyByTaxonomyParams{URL: url, Taxonomy: \"iab-qag\"}\nclassifications, err := client.ClassifyByTaxonomy(params)\nif err != nil {\n  panic(err)\n}\nfor _, c := range classifications.Categories {\n  fmt.Printf(\"%v\\n\", c)\n}","language":"go"},{"code":"string url = \"http://techcrunch.com/2015/07/16/microsoft-will-never-give-up-on-mobile\";\n\nClassifyByTaxonomy classifyByTaxonomy = client.ClassifyByTaxonomy(\"iab-qag\", url: url);\n\nforeach (var category in classifyByTaxonomy.Categories)\n{\n  Console.WriteLine(category.Label);\n}","language":"csharp"}]},"results":{"codes":[{"status":200,"language":"json","code":"{\n  \"categories\": [\n    {\n      \"confident\": true,\n      \"id\": \"IAB19-36\",\n      \"label\": \"Windows\",\n      \"links\": [\n        {\n          \"link\": \"https://api.aylien.com/api/v1/classify/taxonomy/iab-qag/IAB19-36\",\n          \"rel\": \"self\"\n        },\n        {\n          \"link\": \"https://api.aylien.com/api/v1/classify/taxonomy/iab-qag/IAB19\",\n          \"rel\": \"parent\"\n        }\n      ],\n      \"score\": 0.5675236066291172\n    },\n    {\n      \"confident\": true,\n      \"id\": \"IAB19\",\n      \"label\": \"Technology & Computing\",\n      \"links\": [\n        {\n          \"link\": \"https://api.aylien.com/api/v1/classify/taxonomy/iab-qag/IAB19\",\n          \"rel\": \"self\"\n        }\n      ],\n      \"score\": 0.46704140928338533\n    }\n  ],\n  \"language\": \"en\",\n  \"taxonomy\": \"iab-qag\",\n  \"text\": \"When Microsoft announced its wrenching...\"\n}","name":""}]},"settings":"","auth":"required","params":[{"_id":"55fac407bc972f0d0005f648","ref":"","in":"query","required":false,"desc":"Text to classify","default":"","type":"string","name":"text"},{"_id":"55fac407bc972f0d0005f647","ref":"","in":"query","required":false,"desc":"Article or webpage to classify","default":"","type":"string","name":"url"},{"_id":"55fac407bc972f0d0005f646","ref":"","in":"query","required":false,"desc":"Language (refer to [Language Support](/docs/language-support))","default":"en","type":"string","name":"language"},{"_id":"55fac407bc972f0d0005f645","ref":"","in":"path","required":false,"desc":"Taxonomy to classify document according to. Valid options are `iab-qag` and `iptc-subjectcode`","default":"","type":"string","name":"taxonomy"}],"url":"/classify/:taxonomy"},"isReference":false,"order":1,"body":"Knowing the high-level semantic category of an unlabelled document such as a web page or article can be extremely helpful in different applications. The Classification by Taxonomy endpoint helps you categorize any text or URL according to various classification schemes and taxonomies (see the Taxonomies section below).\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Taxonomies\"\n}\n[/block]\nOur Classification by Taxonomy endpoint is capable of classifying content according to multiple taxonomies which can be selected by adding the ID of the taxonomy to the end of the /classify endpoint. Below you can see a list of these taxonomies and their definitions:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Taxonomy\",\n    \"h-1\": \"Number of classes\",\n    \"h-2\": \"Levels of depth\",\n    \"h-3\": \"Commonly used for\",\n    \"h-4\": \"Taxonomy ID\",\n    \"h-5\": \"Definition\",\n    \"0-0\": \"[IPTC Subject Codes](https://iptc.org/standards/subject-codes/)\",\n    \"0-1\": \"1400\",\n    \"0-2\": \"3\",\n    \"1-1\": \"392\",\n    \"1-2\": \"2\",\n    \"1-0\": \"[IAB QAG](http://www.iab.net/QAGInitiative/overview/taxonomy)\",\n    \"0-3\": \"News articles, Blog posts\",\n    \"1-3\": \"Websites, Advertisement (e.g. in OpenRTB, [details](https://dev.twitter.com/mopub/marketplace/iab-categorization))\",\n    \"0-4\": \"`iptc-subjectcode`\",\n    \"1-4\": \"`iab-qag`\",\n    \"0-5\": \"<a href=\\\"https://api.aylien.com/api/v1/classify/taxonomy/iptc-subjectcode\\\" target=\\\"_blank\\\"><i class=\\\"fa fa-eye\\\"></i> View</a>\",\n    \"1-5\": \"<a href=\\\"https://api.aylien.com/api/v1/classify/taxonomy/iab-qag\\\" target=\\\"_blank\\\"><i class=\\\"fa fa-eye\\\"></i> View</a>\"\n  },\n  \"cols\": 6,\n  \"rows\": 2\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Traversing Taxonomies\"\n}\n[/block]\nWe have standardized all our of our supported taxonomies into a tree-like structure, which allows you to easily traverse from child categories to parent categories, recursively.\n\nEach classification result contains an array of `links`, which contains links to the current taxonomy label (`rel=self`) as well as its parent(s), if any (`rel=parent`).\n\nTo retrieve the entire taxonomy, you can simple remove the category ID from the end of the `link` attribute, e.g. https://api.aylien.com/api/v1/classify/taxonomy/iab-qag.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Note\",\n  \"body\": \"Traversing and retrieving the taxonomies does not require authorization, nor is it counted towards your quota.\"\n}\n[/block]","excerpt":"/classify/:taxonomy","slug":"classify-taxonomy","type":"get","title":"Classification by Taxonomy"}

getClassification by Taxonomy

/classify/:taxonomy

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

taxonomy:
string
Taxonomy to classify document according to. Valid options are `iab-qag` and `iptc-subjectcode`

Query Params

text:
string
Text to classify
url:
string
Article or webpage to classify
language:
stringen
Language (refer to [Language Support](/docs/language-support))

Examples


Result Format


Documentation

Knowing the high-level semantic category of an unlabelled document such as a web page or article can be extremely helpful in different applications. The Classification by Taxonomy endpoint helps you categorize any text or URL according to various classification schemes and taxonomies (see the Taxonomies section below). [block:api-header] { "type": "basic", "title": "Taxonomies" } [/block] Our Classification by Taxonomy endpoint is capable of classifying content according to multiple taxonomies which can be selected by adding the ID of the taxonomy to the end of the /classify endpoint. Below you can see a list of these taxonomies and their definitions: [block:parameters] { "data": { "h-0": "Taxonomy", "h-1": "Number of classes", "h-2": "Levels of depth", "h-3": "Commonly used for", "h-4": "Taxonomy ID", "h-5": "Definition", "0-0": "[IPTC Subject Codes](https://iptc.org/standards/subject-codes/)", "0-1": "1400", "0-2": "3", "1-1": "392", "1-2": "2", "1-0": "[IAB QAG](http://www.iab.net/QAGInitiative/overview/taxonomy)", "0-3": "News articles, Blog posts", "1-3": "Websites, Advertisement (e.g. in OpenRTB, [details](https://dev.twitter.com/mopub/marketplace/iab-categorization))", "0-4": "`iptc-subjectcode`", "1-4": "`iab-qag`", "0-5": "<a href=\"https://api.aylien.com/api/v1/classify/taxonomy/iptc-subjectcode\" target=\"_blank\"><i class=\"fa fa-eye\"></i> View</a>", "1-5": "<a href=\"https://api.aylien.com/api/v1/classify/taxonomy/iab-qag\" target=\"_blank\"><i class=\"fa fa-eye\"></i> View</a>" }, "cols": 6, "rows": 2 } [/block] [block:api-header] { "type": "basic", "title": "Traversing Taxonomies" } [/block] We have standardized all our of our supported taxonomies into a tree-like structure, which allows you to easily traverse from child categories to parent categories, recursively. Each classification result contains an array of `links`, which contains links to the current taxonomy label (`rel=self`) as well as its parent(s), if any (`rel=parent`). To retrieve the entire taxonomy, you can simple remove the category ID from the end of the `link` attribute, e.g. https://api.aylien.com/api/v1/classify/taxonomy/iab-qag. [block:callout] { "type": "info", "title": "Note", "body": "Traversing and retrieving the taxonomies does not require authorization, nor is it counted towards your quota." } [/block]

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}