tools.rocks

Default

flagCountriesGet

Lists all available countries

Lists all available countries


/flag/countries

Usage and SDK Samples

curl -X GET\
-H "Accept: application/json"\
"https://tools.rocks/api/v1/flag/countries"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.DefaultApi;

import java.io.File;
import java.util.*;

public class DefaultApiExample {

    public static void main(String[] args) {
        
        DefaultApi apiInstance = new DefaultApi();
        try {
            array[countryCode] result = apiInstance.flagCountriesGet();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#flagCountriesGet");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.DefaultApi;

public class DefaultApiExample {

    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        try {
            array[countryCode] result = apiInstance.flagCountriesGet();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#flagCountriesGet");
            e.printStackTrace();
        }
    }
}

DefaultApi *apiInstance = [[DefaultApi alloc] init];

// Lists all available countries
[apiInstance flagCountriesGetWithCompletionHandler: 
              ^(array[countryCode] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var Toolsrocks = require('toolsrocks');

var api = new Toolsrocks.DefaultApi()
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.flagCountriesGet(callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class flagCountriesGetExample
    {
        public void main()
        {

            var apiInstance = new DefaultApi();

            try
            {
                // Lists all available countries
                array[countryCode] result = apiInstance.flagCountriesGet();
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling DefaultApi.flagCountriesGet: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiDefaultApi();

try {
    $result = $api_instance->flagCountriesGet();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DefaultApi->flagCountriesGet: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::DefaultApi;

my $api_instance = WWW::SwaggerClient::DefaultApi->new();

eval { 
    my $result = $api_instance->flagCountriesGet();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling DefaultApi->flagCountriesGet: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.DefaultApi()

try: 
    # Lists all available countries
    api_response = api_instance.flag_countries_get()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->flagCountriesGet: %s\n" % e)

Parameters

Responses

Status: 200 - OK


flagCountryCodeGet

Get country flag images

Returns the flag for the specified country


/flag/{country_code}

Usage and SDK Samples

curl -X GET\
-H "Accept: image/png,image/jpg,image/svg+xml,application/json"\
"https://tools.rocks/api/v1/flag/{country_code}?format=&width=&height="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.DefaultApi;

import java.io.File;
import java.util.*;

public class DefaultApiExample {

    public static void main(String[] args) {
        
        DefaultApi apiInstance = new DefaultApi();
        countryCode countryCode = ; // countryCode | Country in ISO 3166-1 format
        String format = format_example; // String | The desired file format of the flag image
        Integer width = 56; // Integer | The desired width of the flag image. Ignored if an svg image is requested.
        Integer height = 56; // Integer | The desired height of the flag image. To scale the image by width only (keeping aspect ratio) pass -1 or remove this parameter. Ignored if an svg image is requested.
        try {
            byte[] result = apiInstance.flagCountryCodeGet(countryCode, format, width, height);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#flagCountryCodeGet");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.DefaultApi;

public class DefaultApiExample {

    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        countryCode countryCode = ; // countryCode | Country in ISO 3166-1 format
        String format = format_example; // String | The desired file format of the flag image
        Integer width = 56; // Integer | The desired width of the flag image. Ignored if an svg image is requested.
        Integer height = 56; // Integer | The desired height of the flag image. To scale the image by width only (keeping aspect ratio) pass -1 or remove this parameter. Ignored if an svg image is requested.
        try {
            byte[] result = apiInstance.flagCountryCodeGet(countryCode, format, width, height);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#flagCountryCodeGet");
            e.printStackTrace();
        }
    }
}
countryCode *countryCode = ; // Country in ISO 3166-1 format
String *format = format_example; // The desired file format of the flag image
Integer *width = 56; // The desired width of the flag image. Ignored if an svg image is requested. (optional)
Integer *height = 56; // The desired height of the flag image. To scale the image by width only (keeping aspect ratio) pass -1 or remove this parameter. Ignored if an svg image is requested. (optional) (default to -1)

DefaultApi *apiInstance = [[DefaultApi alloc] init];

// Get country flag images
[apiInstance flagCountryCodeGetWith:countryCode
    format:format
    width:width
    height:height
              completionHandler: ^(byte[] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var Toolsrocks = require('toolsrocks');

var api = new Toolsrocks.DefaultApi()
var countryCode = ; // {{countryCode}} Country in ISO 3166-1 format
var format = format_example; // {{String}} The desired file format of the flag image
var opts = { 
  'width': 56, // {{Integer}} The desired width of the flag image. Ignored if an svg image is requested.
  'height': 56 // {{Integer}} The desired height of the flag image. To scale the image by width only (keeping aspect ratio) pass -1 or remove this parameter. Ignored if an svg image is requested.
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.flagCountryCodeGet(countryCode, format, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class flagCountryCodeGetExample
    {
        public void main()
        {

            var apiInstance = new DefaultApi();
            var countryCode = new countryCode(); // countryCode | Country in ISO 3166-1 format
            var format = format_example;  // String | The desired file format of the flag image
            var width = 56;  // Integer | The desired width of the flag image. Ignored if an svg image is requested. (optional) 
            var height = 56;  // Integer | The desired height of the flag image. To scale the image by width only (keeping aspect ratio) pass -1 or remove this parameter. Ignored if an svg image is requested. (optional)  (default to -1)

            try
            {
                // Get country flag images
                byte[] result = apiInstance.flagCountryCodeGet(countryCode, format, width, height);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling DefaultApi.flagCountryCodeGet: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiDefaultApi();
$countryCode = ; // countryCode | Country in ISO 3166-1 format
$format = format_example; // String | The desired file format of the flag image
$width = 56; // Integer | The desired width of the flag image. Ignored if an svg image is requested.
$height = 56; // Integer | The desired height of the flag image. To scale the image by width only (keeping aspect ratio) pass -1 or remove this parameter. Ignored if an svg image is requested.

try {
    $result = $api_instance->flagCountryCodeGet($countryCode, $format, $width, $height);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DefaultApi->flagCountryCodeGet: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::DefaultApi;

my $api_instance = WWW::SwaggerClient::DefaultApi->new();
my $countryCode = ; # countryCode | Country in ISO 3166-1 format
my $format = format_example; # String | The desired file format of the flag image
my $width = 56; # Integer | The desired width of the flag image. Ignored if an svg image is requested.
my $height = 56; # Integer | The desired height of the flag image. To scale the image by width only (keeping aspect ratio) pass -1 or remove this parameter. Ignored if an svg image is requested.

eval { 
    my $result = $api_instance->flagCountryCodeGet(countryCode => $countryCode, format => $format, width => $width, height => $height);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling DefaultApi->flagCountryCodeGet: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.DefaultApi()
countryCode =  # countryCode | Country in ISO 3166-1 format
format = format_example # String | The desired file format of the flag image
width = 56 # Integer | The desired width of the flag image. Ignored if an svg image is requested. (optional)
height = 56 # Integer | The desired height of the flag image. To scale the image by width only (keeping aspect ratio) pass -1 or remove this parameter. Ignored if an svg image is requested. (optional) (default to -1)

try: 
    # Get country flag images
    api_response = api_instance.flag_country_code_get(countryCode, format, width=width, height=height)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->flagCountryCodeGet: %s\n" % e)

Parameters

Path parameters
Name Description
country_code*
countryCode
Country in ISO 3166-1 format
Required
Query parameters
Name Description
format*
String
The desired file format of the flag image
Required
width
Integer
The desired width of the flag image. Ignored if an svg image is requested.
height
Integer
The desired height of the flag image. To scale the image by width only (keeping aspect ratio) pass -1 or remove this parameter. Ignored if an svg image is requested.

Responses

Status: 200 - Success. Returns the flag in the specified size and format.

Status: 400 - An invalid request has been made

Status: 404 - No flag was found for the given language code


flagFormatsGet

Lists all possible image formats

Lists all image formats currently supported by this API


/flag/formats

Usage and SDK Samples

curl -X GET\
-H "Accept: application/json"\
"https://tools.rocks/api/v1/flag/formats"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.DefaultApi;

import java.io.File;
import java.util.*;

public class DefaultApiExample {

    public static void main(String[] args) {
        
        DefaultApi apiInstance = new DefaultApi();
        try {
            array['String'] result = apiInstance.flagFormatsGet();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#flagFormatsGet");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.DefaultApi;

public class DefaultApiExample {

    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        try {
            array['String'] result = apiInstance.flagFormatsGet();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#flagFormatsGet");
            e.printStackTrace();
        }
    }
}

DefaultApi *apiInstance = [[DefaultApi alloc] init];

// Lists all possible image formats
[apiInstance flagFormatsGetWithCompletionHandler: 
              ^(array['String'] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var Toolsrocks = require('toolsrocks');

var api = new Toolsrocks.DefaultApi()
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.flagFormatsGet(callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class flagFormatsGetExample
    {
        public void main()
        {

            var apiInstance = new DefaultApi();

            try
            {
                // Lists all possible image formats
                array['String'] result = apiInstance.flagFormatsGet();
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling DefaultApi.flagFormatsGet: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiDefaultApi();

try {
    $result = $api_instance->flagFormatsGet();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DefaultApi->flagFormatsGet: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::DefaultApi;

my $api_instance = WWW::SwaggerClient::DefaultApi->new();

eval { 
    my $result = $api_instance->flagFormatsGet();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling DefaultApi->flagFormatsGet: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.DefaultApi()

try: 
    # Lists all possible image formats
    api_response = api_instance.flag_formats_get()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->flagFormatsGet: %s\n" % e)

Parameters

Responses

Status: 200 - OK


genderBatchPost

Gets multiple names' associated gender

Returns the most likely gender associated with a name, dependant on a given origin country of the name. If no gender information can be found for the provided country, the country will be ignored and the gender that is correct for the highest number of countries will be returned. Accepts multiple names separated by newlines.


/gender/batch

Usage and SDK Samples

curl -X POST\
-H "Accept: application/json"\
"https://tools.rocks/api/v1/gender/batch?country_code=&exact="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.DefaultApi;

import java.io.File;
import java.util.*;

public class DefaultApiExample {

    public static void main(String[] args) {
        
        DefaultApi apiInstance = new DefaultApi();
        countryCode countryCode = ; // countryCode | Origin country of the name in ISO 3166-1 format
        Boolean exact = true; // Boolean | Whether the whole row should be used for matching or not. Otherwise, only the first word of each row will be used for searching the gender. (This option should only be set if the data set contains persons with multiple first names.)
        try {
            array[nameGenderResponse] result = apiInstance.genderBatchPost(countryCode, exact);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#genderBatchPost");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.DefaultApi;

public class DefaultApiExample {

    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        countryCode countryCode = ; // countryCode | Origin country of the name in ISO 3166-1 format
        Boolean exact = true; // Boolean | Whether the whole row should be used for matching or not. Otherwise, only the first word of each row will be used for searching the gender. (This option should only be set if the data set contains persons with multiple first names.)
        try {
            array[nameGenderResponse] result = apiInstance.genderBatchPost(countryCode, exact);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#genderBatchPost");
            e.printStackTrace();
        }
    }
}
countryCode *countryCode = ; // Origin country of the name in ISO 3166-1 format (optional)
Boolean *exact = true; // Whether the whole row should be used for matching or not. Otherwise, only the first word of each row will be used for searching the gender. (This option should only be set if the data set contains persons with multiple first names.) (optional) (default to false)

DefaultApi *apiInstance = [[DefaultApi alloc] init];

// Gets multiple names' associated gender
[apiInstance genderBatchPostWith:countryCode
    exact:exact
              completionHandler: ^(array[nameGenderResponse] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var Toolsrocks = require('toolsrocks');

var api = new Toolsrocks.DefaultApi()
var opts = { 
  'countryCode': , // {{countryCode}} Origin country of the name in ISO 3166-1 format
  'exact': true // {{Boolean}} Whether the whole row should be used for matching or not. Otherwise, only the first word of each row will be used for searching the gender. (This option should only be set if the data set contains persons with multiple first names.)
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.genderBatchPost(opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class genderBatchPostExample
    {
        public void main()
        {

            var apiInstance = new DefaultApi();
            var countryCode = new countryCode(); // countryCode | Origin country of the name in ISO 3166-1 format (optional) 
            var exact = true;  // Boolean | Whether the whole row should be used for matching or not. Otherwise, only the first word of each row will be used for searching the gender. (This option should only be set if the data set contains persons with multiple first names.) (optional)  (default to false)

            try
            {
                // Gets multiple names' associated gender
                array[nameGenderResponse] result = apiInstance.genderBatchPost(countryCode, exact);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling DefaultApi.genderBatchPost: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiDefaultApi();
$countryCode = ; // countryCode | Origin country of the name in ISO 3166-1 format
$exact = true; // Boolean | Whether the whole row should be used for matching or not. Otherwise, only the first word of each row will be used for searching the gender. (This option should only be set if the data set contains persons with multiple first names.)

try {
    $result = $api_instance->genderBatchPost($countryCode, $exact);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DefaultApi->genderBatchPost: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::DefaultApi;

my $api_instance = WWW::SwaggerClient::DefaultApi->new();
my $countryCode = ; # countryCode | Origin country of the name in ISO 3166-1 format
my $exact = true; # Boolean | Whether the whole row should be used for matching or not. Otherwise, only the first word of each row will be used for searching the gender. (This option should only be set if the data set contains persons with multiple first names.)

eval { 
    my $result = $api_instance->genderBatchPost(countryCode => $countryCode, exact => $exact);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling DefaultApi->genderBatchPost: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.DefaultApi()
countryCode =  # countryCode | Origin country of the name in ISO 3166-1 format (optional)
exact = true # Boolean | Whether the whole row should be used for matching or not. Otherwise, only the first word of each row will be used for searching the gender. (This option should only be set if the data set contains persons with multiple first names.) (optional) (default to false)

try: 
    # Gets multiple names' associated gender
    api_response = api_instance.gender_batch_post(countryCode=countryCode, exact=exact)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->genderBatchPost: %s\n" % e)

Parameters

Query parameters
Name Description
country_code
countryCode
Origin country of the name in ISO 3166-1 format
exact
Boolean
Whether the whole row should be used for matching or not. Otherwise, only the first word of each row will be used for searching the gender. (This option should only be set if the data set contains persons with multiple first names.)

Responses

Status: 200 - OK

Status: 400 - An invalid request has been made


genderCountriesGet

Lists all possible countries

Lists all countries currently supported for name/gender lookup


/gender/countries

Usage and SDK Samples

curl -X GET\
-H "Accept: application/json"\
"https://tools.rocks/api/v1/gender/countries"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.DefaultApi;

import java.io.File;
import java.util.*;

public class DefaultApiExample {

    public static void main(String[] args) {
        
        DefaultApi apiInstance = new DefaultApi();
        try {
            array[countryCode] result = apiInstance.genderCountriesGet();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#genderCountriesGet");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.DefaultApi;

public class DefaultApiExample {

    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        try {
            array[countryCode] result = apiInstance.genderCountriesGet();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#genderCountriesGet");
            e.printStackTrace();
        }
    }
}

DefaultApi *apiInstance = [[DefaultApi alloc] init];

// Lists all possible countries
[apiInstance genderCountriesGetWithCompletionHandler: 
              ^(array[countryCode] output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var Toolsrocks = require('toolsrocks');

var api = new Toolsrocks.DefaultApi()
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.genderCountriesGet(callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class genderCountriesGetExample
    {
        public void main()
        {

            var apiInstance = new DefaultApi();

            try
            {
                // Lists all possible countries
                array[countryCode] result = apiInstance.genderCountriesGet();
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling DefaultApi.genderCountriesGet: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiDefaultApi();

try {
    $result = $api_instance->genderCountriesGet();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DefaultApi->genderCountriesGet: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::DefaultApi;

my $api_instance = WWW::SwaggerClient::DefaultApi->new();

eval { 
    my $result = $api_instance->genderCountriesGet();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling DefaultApi->genderCountriesGet: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.DefaultApi()

try: 
    # Lists all possible countries
    api_response = api_instance.gender_countries_get()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->genderCountriesGet: %s\n" % e)

Parameters

Responses

Status: 200 - OK


genderNameGet

Gets a name's associated gender

Returns the most likely gender associated with a name, dependant on a given origin country of the name. If no gender information can be found for the provided country, the country will be ignored and the gender that is correct for the highest number of countries will be returned.


/gender/{name}

Usage and SDK Samples

curl -X GET\
-H "Accept: application/json"\
"https://tools.rocks/api/v1/gender/{name}?country_code="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.DefaultApi;

import java.io.File;
import java.util.*;

public class DefaultApiExample {

    public static void main(String[] args) {
        
        DefaultApi apiInstance = new DefaultApi();
        String name = name_example; // String | The name to get gender for
        countryCode countryCode = ; // countryCode | Origin country of the name in ISO 3166-1 format
        try {
            nameGenderResponse result = apiInstance.genderNameGet(name, countryCode);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#genderNameGet");
            e.printStackTrace();
        }
    }
}
import io.swagger.client.api.DefaultApi;

public class DefaultApiExample {

    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        String name = name_example; // String | The name to get gender for
        countryCode countryCode = ; // countryCode | Origin country of the name in ISO 3166-1 format
        try {
            nameGenderResponse result = apiInstance.genderNameGet(name, countryCode);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling DefaultApi#genderNameGet");
            e.printStackTrace();
        }
    }
}
String *name = name_example; // The name to get gender for
countryCode *countryCode = ; // Origin country of the name in ISO 3166-1 format (optional)

DefaultApi *apiInstance = [[DefaultApi alloc] init];

// Gets a name's associated gender
[apiInstance genderNameGetWith:name
    countryCode:countryCode
              completionHandler: ^(nameGenderResponse output, NSError* error) {
                            if (output) {
                                NSLog(@"%@", output);
                            }
                            if (error) {
                                NSLog(@"Error: %@", error);
                            }
                        }];
var Toolsrocks = require('toolsrocks');

var api = new Toolsrocks.DefaultApi()
var name = name_example; // {{String}} The name to get gender for
var opts = { 
  'countryCode':  // {{countryCode}} Origin country of the name in ISO 3166-1 format
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.genderNameGet(name, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class genderNameGetExample
    {
        public void main()
        {

            var apiInstance = new DefaultApi();
            var name = name_example;  // String | The name to get gender for
            var countryCode = new countryCode(); // countryCode | Origin country of the name in ISO 3166-1 format (optional) 

            try
            {
                // Gets a name's associated gender
                nameGenderResponse result = apiInstance.genderNameGet(name, countryCode);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling DefaultApi.genderNameGet: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiDefaultApi();
$name = name_example; // String | The name to get gender for
$countryCode = ; // countryCode | Origin country of the name in ISO 3166-1 format

try {
    $result = $api_instance->genderNameGet($name, $countryCode);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DefaultApi->genderNameGet: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::DefaultApi;

my $api_instance = WWW::SwaggerClient::DefaultApi->new();
my $name = name_example; # String | The name to get gender for
my $countryCode = ; # countryCode | Origin country of the name in ISO 3166-1 format

eval { 
    my $result = $api_instance->genderNameGet(name => $name, countryCode => $countryCode);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling DefaultApi->genderNameGet: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.DefaultApi()
name = name_example # String | The name to get gender for
countryCode =  # countryCode | Origin country of the name in ISO 3166-1 format (optional)

try: 
    # Gets a name's associated gender
    api_response = api_instance.gender_name_get(name, countryCode=countryCode)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling DefaultApi->genderNameGet: %s\n" % e)

Parameters

Path parameters
Name Description
name*
String
The name to get gender for
Required
Query parameters
Name Description
country_code
countryCode
Origin country of the name in ISO 3166-1 format

Responses

Status: 200 - OK

Status: 400 - An invalid request has been made

Status: 404 - The database does not contain any information for the given name/country pair


phoneFormatPost

Format phone numbers

Validates and transforms phone numbers


/phone/{format}

Usage and SDK Samples

curl -X POST\
-H "Accept: application/json"\
-H "Content-Type: text/plain"\
"https://tools.rocks/api/v1/phone/{format}?spaced_area_code=&spaced_country_code="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.DefaultApi;

import java.io.File;
import java.util.*;

public class DefaultApiExample {

    public static void main(String[] args) {
        
        DefaultApi apiInstance = new DefaultApi();
        String body = "030 23125 349,(0)221 4710 977,01729091317,invalid"; // String | The phone number(s) to format as text. Numbers can be seperated by comma, semicolon or newline.
        String format = format_example; // String | How to format the phone numbers. Possible values are:
"local" - number without country code, e.g. 01784001420
"plus" - country code specified with a leading +, e.g. +491784001420
"zero" - country code specified with leading zeroes, e.g. 00491784001420 Boolean spacedAreaCode = true; // Boolean | If true, adds a space character after the area code Boolean spacedCountryCode = true; // Boolean | If true, adds a space character after the country code try { inline_response_200 result = apiInstance.phoneFormatPost(body, format, spacedAreaCode, spacedCountryCode); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling DefaultApi#phoneFormatPost"); e.printStackTrace(); } } }
import io.swagger.client.api.DefaultApi;

public class DefaultApiExample {

    public static void main(String[] args) {
        DefaultApi apiInstance = new DefaultApi();
        String body = "030 23125 349,(0)221 4710 977,01729091317,invalid"; // String | The phone number(s) to format as text. Numbers can be seperated by comma, semicolon or newline.
        String format = format_example; // String | How to format the phone numbers. Possible values are:
"local" - number without country code, e.g. 01784001420
"plus" - country code specified with a leading +, e.g. +491784001420
"zero" - country code specified with leading zeroes, e.g. 00491784001420 Boolean spacedAreaCode = true; // Boolean | If true, adds a space character after the area code Boolean spacedCountryCode = true; // Boolean | If true, adds a space character after the country code try { inline_response_200 result = apiInstance.phoneFormatPost(body, format, spacedAreaCode, spacedCountryCode); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling DefaultApi#phoneFormatPost"); e.printStackTrace(); } } }
String *body = "030 23125 349,(0)221 4710 977,01729091317,invalid"; // The phone number(s) to format as text. Numbers can be seperated by comma, semicolon or newline.
String *format = format_example; // How to format the phone numbers. Possible values are:
"local" - number without country code, e.g. 01784001420
"plus" - country code specified with a leading +, e.g. +491784001420
"zero" - country code specified with leading zeroes, e.g. 00491784001420 Boolean *spacedAreaCode = true; // If true, adds a space character after the area code (optional) (default to true) Boolean *spacedCountryCode = true; // If true, adds a space character after the country code (optional) (default to true) DefaultApi *apiInstance = [[DefaultApi alloc] init]; // Format phone numbers [apiInstance phoneFormatPostWith:body format:format spacedAreaCode:spacedAreaCode spacedCountryCode:spacedCountryCode completionHandler: ^(inline_response_200 output, NSError* error) { if (output) { NSLog(@"%@", output); } if (error) { NSLog(@"Error: %@", error); } }];
var Toolsrocks = require('toolsrocks');

var api = new Toolsrocks.DefaultApi()
var body = "030 23125 349,(0)221 4710 977,01729091317,invalid"; // {{String}} The phone number(s) to format as text. Numbers can be seperated by comma, semicolon or newline.
var format = format_example; // {{String}} How to format the phone numbers. Possible values are:
"local" - number without country code, e.g. 01784001420
"plus" - country code specified with a leading +, e.g. +491784001420
"zero" - country code specified with leading zeroes, e.g. 00491784001420 var opts = { 'spacedAreaCode': true // {{Boolean}} If true, adds a space character after the area code 'spacedCountryCode': true // {{Boolean}} If true, adds a space character after the country code }; var callback = function(error, data, response) { if (error) { console.error(error); } else { console.log('API called successfully. Returned data: ' + data); } }; api.phoneFormatPost(bodyformat, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;

namespace Example
{
    public class phoneFormatPostExample
    {
        public void main()
        {

            var apiInstance = new DefaultApi();
            var body = new String(); // String | The phone number(s) to format as text. Numbers can be seperated by comma, semicolon or newline.
            var format = format_example;  // String | How to format the phone numbers. Possible values are:
"local" - number without country code, e.g. 01784001420
"plus" - country code specified with a leading +, e.g. +491784001420
"zero" - country code specified with leading zeroes, e.g. 00491784001420 var spacedAreaCode = true; // Boolean | If true, adds a space character after the area code (optional) (default to true) var spacedCountryCode = true; // Boolean | If true, adds a space character after the country code (optional) (default to true) try { // Format phone numbers inline_response_200 result = apiInstance.phoneFormatPost(body, format, spacedAreaCode, spacedCountryCode); Debug.WriteLine(result); } catch (Exception e) { Debug.Print("Exception when calling DefaultApi.phoneFormatPost: " + e.Message ); } } } }
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$api_instance = new Swagger\Client\ApiDefaultApi();
$body = "030 23125 349,(0)221 4710 977,01729091317,invalid"; // String | The phone number(s) to format as text. Numbers can be seperated by comma, semicolon or newline.
$format = format_example; // String | How to format the phone numbers. Possible values are:
"local" - number without country code, e.g. 01784001420
"plus" - country code specified with a leading +, e.g. +491784001420
"zero" - country code specified with leading zeroes, e.g. 00491784001420 $spacedAreaCode = true; // Boolean | If true, adds a space character after the area code $spacedCountryCode = true; // Boolean | If true, adds a space character after the country code try { $result = $api_instance->phoneFormatPost($body, $format, $spacedAreaCode, $spacedCountryCode); print_r($result); } catch (Exception $e) { echo 'Exception when calling DefaultApi->phoneFormatPost: ', $e->getMessage(), PHP_EOL; } ?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::DefaultApi;

my $api_instance = WWW::SwaggerClient::DefaultApi->new();
my $body = WWW::SwaggerClient::Object::String->new(); # String | The phone number(s) to format as text. Numbers can be seperated by comma, semicolon or newline.
my $format = format_example; # String | How to format the phone numbers. Possible values are:
"local" - number without country code, e.g. 01784001420
"plus" - country code specified with a leading +, e.g. +491784001420
"zero" - country code specified with leading zeroes, e.g. 00491784001420 my $spacedAreaCode = true; # Boolean | If true, adds a space character after the area code my $spacedCountryCode = true; # Boolean | If true, adds a space character after the country code eval { my $result = $api_instance->phoneFormatPost(body => $body, format => $format, spacedAreaCode => $spacedAreaCode, spacedCountryCode => $spacedCountryCode); print Dumper($result); }; if ($@) { warn "Exception when calling DefaultApi->phoneFormatPost: $@\n"; }
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.DefaultApi()
body = "030 23125 349,(0)221 4710 977,01729091317,invalid" # String | The phone number(s) to format as text. Numbers can be seperated by comma, semicolon or newline.
format = format_example # String | How to format the phone numbers. Possible values are:
"local" - number without country code, e.g. 01784001420
"plus" - country code specified with a leading +, e.g. +491784001420
"zero" - country code specified with leading zeroes, e.g. 00491784001420 spacedAreaCode = true # Boolean | If true, adds a space character after the area code (optional) (default to true) spacedCountryCode = true # Boolean | If true, adds a space character after the country code (optional) (default to true) try: # Format phone numbers api_response = api_instance.phone_format_post(body, format, spacedAreaCode=spacedAreaCode, spacedCountryCode=spacedCountryCode) pprint(api_response) except ApiException as e: print("Exception when calling DefaultApi->phoneFormatPost: %s\n" % e)

Parameters

Path parameters
Name Description
format*
String
How to format the phone numbers. Possible values are:<br> "local" - number without country code, e.g. 01784001420<br> "plus" - country code specified with a leading +, e.g. +491784001420<br> "zero" - country code specified with leading zeroes, e.g. 00491784001420
Required
Body parameters
Name Description
body *
Query parameters
Name Description
spaced_area_code
Boolean
If true, adds a space character after the area code
spaced_country_code
Boolean
If true, adds a space character after the country code

Responses

Status: 200 - Phone number(s) validated and transformed successfully

Status: 400 - Bad request. Additional details on the error will be provided in the message body