GET taxonomy/name/:name

Search for a taxonomic id by a non-scientific name

Parameters

Required

NameTypeDescriptionDefaultExample Values
name String A non-scientific species name. Can include SQL wildcards - Homo%25

Optional

NameTypeDescriptionDefaultExample Values
callback String Name of the callback subroutine to be returned by the requested JSONP response. Required ONLY when using JSONP as the serialisation method. Please see the user guide. - randomlygeneratedname

Example Requests

/taxonomy/name/Homo%25?content-type=application/json


  1. use strict;
  2. use warnings;
  3.  
  4. use HTTP::Tiny;
  5.  
  6. my $http = HTTP::Tiny->new();
  7.  
  8. my $server = 'https://jan2020.rest.ensembl.org';
  9. my $ext = '/taxonomy/name/Homo%2525?';
  10. my $response = $http->get($server.$ext, {
  11. headers => { 'Content-type' => 'application/json' }
  12. });
  13.  
  14. die "Failed!\n" unless $response->{success};
  15.  
  16.  
  17. use JSON;
  18. use Data::Dumper;
  19. if(length $response->{content}) {
  20. my $hash = decode_json($response->{content});
  21. local $Data::Dumper::Terse = 1;
  22. local $Data::Dumper::Indent = 1;
  23. print Dumper $hash;
  24. print "\n";
  25. }
  26.  
  1. import requests, sys
  2.  
  3. server = "https://jan2020.rest.ensembl.org"
  4. ext = "/taxonomy/name/Homo%25?"
  5.  
  6. r = requests.get(server+ext, headers={ "Content-Type" : "application/json"})
  7.  
  8. if not r.ok:
  9. r.raise_for_status()
  10. sys.exit()
  11.  
  12. decoded = r.json()
  13. print repr(decoded)
  14.  
  1. import requests, sys
  2.  
  3. server = "https://jan2020.rest.ensembl.org"
  4. ext = "/taxonomy/name/Homo%25?"
  5.  
  6. r = requests.get(server+ext, headers={ "Content-Type" : "application/json"})
  7.  
  8. if not r.ok:
  9. r.raise_for_status()
  10. sys.exit()
  11.  
  12. decoded = r.json()
  13. print(repr(decoded))
  14.  
  1. require 'net/http'
  2. require 'uri'
  3.  
  4. server='https://jan2020.rest.ensembl.org'
  5. path = '/taxonomy/name/Homo%2525?'
  6.  
  7. url = URI.parse(server)
  8. http = Net::HTTP.new(url.host, url.port)
  9.  
  10. request = Net::HTTP::Get.new(path, {'Content-Type' => 'application/json'})
  11.  
  12. response = http.request(request)
  13.  
  14. if response.code != "200"
  15. puts "Invalid response: #{response.code}"
  16. puts response.body
  17. exit
  18. end
  19.  
  20.  
  21. require 'rubygems'
  22. require 'json'
  23. require 'yaml'
  24.  
  25. result = JSON.parse(response.body)
  26. puts YAML::dump(result)
  27.  
  1. import java.net.URL;
  2. import java.net.URLConnection;
  3. import java.net.HttpURLConnection;
  4. import java.io.BufferedReader;
  5. import java.io.InputStream;
  6. import java.io.InputStreamReader;
  7. import java.io.IOException;
  8. import java.io.Reader;
  9.  
  10.  
  11. public class EnsemblRest {
  12.  
  13. public static void main(String[] args) throws Exception {
  14. String server = "https://jan2020.rest.ensembl.org";
  15. String ext = "/taxonomy/name/Homo%2525?";
  16. URL url = new URL(server + ext);
  17.  
  18. URLConnection connection = url.openConnection();
  19. HttpURLConnection httpConnection = (HttpURLConnection)connection;
  20. httpConnection.setRequestProperty("Content-Type", "application/json");
  21.  
  22. InputStream response = connection.getInputStream();
  23. int responseCode = httpConnection.getResponseCode();
  24.  
  25. if(responseCode != 200) {
  26. throw new RuntimeException("Response code was not 200. Detected response was "+responseCode);
  27. }
  28.  
  29. String output;
  30. Reader reader = null;
  31. try {
  32. reader = new BufferedReader(new InputStreamReader(response, "UTF-8"));
  33. StringBuilder builder = new StringBuilder();
  34. char[] buffer = new char[8192];
  35. int read;
  36. while ((read = reader.read(buffer, 0, buffer.length)) > 0) {
  37. builder.append(buffer, 0, read);
  38. }
  39. output = builder.toString();
  40. }
  41. finally {
  42. if (reader != null) try {
  43. reader.close();
  44. } catch (IOException logOrIgnore) {
  45. logOrIgnore.printStackTrace();
  46. }
  47. }
  48.  
  49. System.out.println(output);
  50. }
  51. }
  52.  
  1. library(httr)
  2. library(jsonlite)
  3. library(xml2)
  4.  
  5. server <- "https://jan2020.rest.ensembl.org"
  6. ext <- "/taxonomy/name/Homo%25?"
  7.  
  8. r <- GET(paste(server, ext, sep = ""), content_type("application/json"))
  9.  
  10. stop_for_status(r)
  11.  
  12. # use this if you get a simple nested list back, otherwise inspect its structure
  13. # head(data.frame(t(sapply(content(r),c))))
  14. head(fromJSON(toJSON(content(r))))
  15.  
  1.  
  2. curl 'https://jan2020.rest.ensembl.org/taxonomy/name/Homo%2525?' -H 'Content-type:application/json'
  3.  
  1. wget -q --header='Content-type:application/json' 'https://jan2020.rest.ensembl.org/taxonomy/name/Homo%25?' -O -
  2.  

/taxonomy/name/human?content-type=application/json


 [
  {
    "children": [
      {
        "scientific_name": "Homo sapiens subsp. 'Denisova'",
        "tags": {
          "synonym": [
            "Homo sp. Altai"
          ],
          "equivalent_name": [
            "Homo sapiens ssp. 'Denisova'",
            "Homo sapiens ssp. Denisova"
          ],
          "common_name": [
            "Denisovan",
            "Denisovans"
          ],
          "genbank_common_name": [
            "Denisova hominin"
          ],
          "scientific_name": [
            "Homo sapiens subsp. 'Denisova'"
          ],
          "name": [
            "Homo sapiens subsp. 'Denisova'"
          ]
        },
        "name": "Homo sapiens subsp. 'Denisova'",
        "leaf": 1,
        "id": "741158"
      },
      {
        "scientific_name": "Homo sapiens neanderthalensis",
        "tags": {
          "scientific_name": [
            "Homo sapiens neanderthalensis"
          ],
          "genbank_common_name": [
            "Neandertal"
          ],
          "authority": [
            "Homo sapiens neanderthalensis King, 1864"
          ],
          "synonym": [
            "Homo neanderthalensis"
          ],
          "common_name": [
            "Neandertal man",
            "Neanderthal",
            "Neanderthal man"
          ],
          "type_material": [
            "Feldhofer 1",
            "Neanderthal 1"
          ],
          "name": [
            "Homo sapiens neanderthalensis"
          ]
        },
        "id": "63221",
        "leaf": 1,
        "name": "Homo sapiens neanderthalensis"
      }
    ],
    "parent": {
      "scientific_name": "Homo",
      "tags": {
        "scientific_name": [
          "Homo"
        ],
        "common_name": [
          "humans"
        ],
        "authority": [
          "Homo Linnaeus, 1758"
        ],
        "name": [
          "Homo"
        ]
      },
      "name": "Homo",
      "id": "9605",
      "leaf": 0
    },
    "tags": {
      "authority": [
        "Homo sapiens Linnaeus, 1758"
      ],
      "genbank_common_name": [
        "human"
      ],
      "scientific_name": [
        "Homo sapiens"
      ],
      "name": [
        "Homo sapiens"
      ]
    },
    "scientific_name": "Homo sapiens",
    "id": "9606",
    "leaf": 0,
    "name": "Homo sapiens"
  }
]
  1. use strict;
  2. use warnings;
  3.  
  4. use HTTP::Tiny;
  5.  
  6. my $http = HTTP::Tiny->new();
  7.  
  8. my $server = 'https://jan2020.rest.ensembl.org';
  9. my $ext = '/taxonomy/name/human?';
  10. my $response = $http->get($server.$ext, {
  11. headers => { 'Content-type' => 'application/json' }
  12. });
  13.  
  14. die "Failed!\n" unless $response->{success};
  15.  
  16.  
  17. use JSON;
  18. use Data::Dumper;
  19. if(length $response->{content}) {
  20. my $hash = decode_json($response->{content});
  21. local $Data::Dumper::Terse = 1;
  22. local $Data::Dumper::Indent = 1;
  23. print Dumper $hash;
  24. print "\n";
  25. }
  26.  
  1. import requests, sys
  2.  
  3. server = "https://jan2020.rest.ensembl.org"
  4. ext = "/taxonomy/name/human?"
  5.  
  6. r = requests.get(server+ext, headers={ "Content-Type" : "application/json"})
  7.  
  8. if not r.ok:
  9. r.raise_for_status()
  10. sys.exit()
  11.  
  12. decoded = r.json()
  13. print repr(decoded)
  14.  
  1. import requests, sys
  2.  
  3. server = "https://jan2020.rest.ensembl.org"
  4. ext = "/taxonomy/name/human?"
  5.  
  6. r = requests.get(server+ext, headers={ "Content-Type" : "application/json"})
  7.  
  8. if not r.ok:
  9. r.raise_for_status()
  10. sys.exit()
  11.  
  12. decoded = r.json()
  13. print(repr(decoded))
  14.  
  1. require 'net/http'
  2. require 'uri'
  3.  
  4. server='https://jan2020.rest.ensembl.org'
  5. path = '/taxonomy/name/human?'
  6.  
  7. url = URI.parse(server)
  8. http = Net::HTTP.new(url.host, url.port)
  9.  
  10. request = Net::HTTP::Get.new(path, {'Content-Type' => 'application/json'})
  11.  
  12. response = http.request(request)
  13.  
  14. if response.code != "200"
  15. puts "Invalid response: #{response.code}"
  16. puts response.body
  17. exit
  18. end
  19.  
  20.  
  21. require 'rubygems'
  22. require 'json'
  23. require 'yaml'
  24.  
  25. result = JSON.parse(response.body)
  26. puts YAML::dump(result)
  27.  
  1. import java.net.URL;
  2. import java.net.URLConnection;
  3. import java.net.HttpURLConnection;
  4. import java.io.BufferedReader;
  5. import java.io.InputStream;
  6. import java.io.InputStreamReader;
  7. import java.io.IOException;
  8. import java.io.Reader;
  9.  
  10.  
  11. public class EnsemblRest {
  12.  
  13. public static void main(String[] args) throws Exception {
  14. String server = "https://jan2020.rest.ensembl.org";
  15. String ext = "/taxonomy/name/human?";
  16. URL url = new URL(server + ext);
  17.  
  18. URLConnection connection = url.openConnection();
  19. HttpURLConnection httpConnection = (HttpURLConnection)connection;
  20. httpConnection.setRequestProperty("Content-Type", "application/json");
  21.  
  22. InputStream response = connection.getInputStream();
  23. int responseCode = httpConnection.getResponseCode();
  24.  
  25. if(responseCode != 200) {
  26. throw new RuntimeException("Response code was not 200. Detected response was "+responseCode);
  27. }
  28.  
  29. String output;
  30. Reader reader = null;
  31. try {
  32. reader = new BufferedReader(new InputStreamReader(response, "UTF-8"));
  33. StringBuilder builder = new StringBuilder();
  34. char[] buffer = new char[8192];
  35. int read;
  36. while ((read = reader.read(buffer, 0, buffer.length)) > 0) {
  37. builder.append(buffer, 0, read);
  38. }
  39. output = builder.toString();
  40. }
  41. finally {
  42. if (reader != null) try {
  43. reader.close();
  44. } catch (IOException logOrIgnore) {
  45. logOrIgnore.printStackTrace();
  46. }
  47. }
  48.  
  49. System.out.println(output);
  50. }
  51. }
  52.  
  1. library(httr)
  2. library(jsonlite)
  3. library(xml2)
  4.  
  5. server <- "https://jan2020.rest.ensembl.org"
  6. ext <- "/taxonomy/name/human?"
  7.  
  8. r <- GET(paste(server, ext, sep = ""), content_type("application/json"))
  9.  
  10. stop_for_status(r)
  11.  
  12. # use this if you get a simple nested list back, otherwise inspect its structure
  13. # head(data.frame(t(sapply(content(r),c))))
  14. head(fromJSON(toJSON(content(r))))
  15.  
  1.  
  2. curl 'https://jan2020.rest.ensembl.org/taxonomy/name/human?' -H 'Content-type:application/json'
  3.  
  1. wget -q --header='Content-type:application/json' 'https://jan2020.rest.ensembl.org/taxonomy/name/human?' -O -
  2.  

Resource Information

MethodsGET
Response formatsjson
xml
yaml
jsonp