cities
Provides a simple listing of cities within the platform.
/cities
Usage and SDK Samples
curl -X GET -H "apieco-key: [[apiKey]]" "https://api.apieco.ir/openaq/cities?country=&order_by=&sort=&limit=&page="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.CitiesApi;
import java.io.File;
import java.util.*;
public class CitiesApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: apieco-key
ApiKeyAuth apieco-key = (ApiKeyAuth) defaultClient.getAuthentication("apieco-key");
apieco-key.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apieco-key.setApiKeyPrefix("Token");
CitiesApi apiInstance = new CitiesApi();
String apiecoKey = apiecoKey_example; // String |
String country = country_example; // String | Limit results by a certain country.
array[String] orderBy = ; // array[String] | Order by one or more fields (ex. order_by=country or order_by[]=country&order_by[]=locations).
Default value: country
array[String] sort = ; // array[String] | Define sort order for one or more fields (ex. sort=desc or sort[]=asc&sort[]=desc).
Default value: asc
BigDecimal limit = 8.14; // BigDecimal | Change the number of results returned, max is 10000.
Default value: 100
BigDecimal page = 8.14; // BigDecimal | aginate through results.
Default value: 1
try {
inline_response_200 result = apiInstance.cities(apiecoKey, country, orderBy, sort, limit, page);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CitiesApi#cities");
e.printStackTrace();
}
}
}
import io.swagger.client.api.CitiesApi;
public class CitiesApiExample {
public static void main(String[] args) {
CitiesApi apiInstance = new CitiesApi();
String apiecoKey = apiecoKey_example; // String |
String country = country_example; // String | Limit results by a certain country.
array[String] orderBy = ; // array[String] | Order by one or more fields (ex. order_by=country or order_by[]=country&order_by[]=locations).
Default value: country
array[String] sort = ; // array[String] | Define sort order for one or more fields (ex. sort=desc or sort[]=asc&sort[]=desc).
Default value: asc
BigDecimal limit = 8.14; // BigDecimal | Change the number of results returned, max is 10000.
Default value: 100
BigDecimal page = 8.14; // BigDecimal | aginate through results.
Default value: 1
try {
inline_response_200 result = apiInstance.cities(apiecoKey, country, orderBy, sort, limit, page);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CitiesApi#cities");
e.printStackTrace();
}
}
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure API key authorization: (authentication scheme: apieco-key)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"apieco-key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"apieco-key"];
String *apiecoKey = apiecoKey_example; //
String *country = country_example; // Limit results by a certain country. (optional)
array[String] *orderBy = ; // Order by one or more fields (ex. order_by=country or order_by[]=country&order_by[]=locations).
Default value: country (optional)
array[String] *sort = ; // Define sort order for one or more fields (ex. sort=desc or sort[]=asc&sort[]=desc).
Default value: asc (optional)
BigDecimal *limit = 8.14; // Change the number of results returned, max is 10000.
Default value: 100 (optional)
BigDecimal *page = 8.14; // aginate through results.
Default value: 1 (optional)
CitiesApi *apiInstance = [[CitiesApi alloc] init];
[apiInstance citiesWith:apiecoKey
country:country
orderBy:orderBy
sort:sort
limit:limit
page:page
completionHandler: ^(inline_response_200 output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var OpenAqPlatformApi = require('open_aq_platform_api');
var defaultClient = OpenAqPlatformApi.ApiClient.instance;
// Configure API key authorization: apieco-key
var apieco-key = defaultClient.authentications['apieco-key'];
apieco-key.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//apieco-key.apiKeyPrefix['apieco-key'] = "Token"
var api = new OpenAqPlatformApi.CitiesApi()
var apiecoKey = apiecoKey_example; // {String}
var opts = {
'country': country_example, // {String} Limit results by a certain country.
'orderBy': , // {array[String]} Order by one or more fields (ex. order_by=country or order_by[]=country&order_by[]=locations).
Default value: country
'sort': , // {array[String]} Define sort order for one or more fields (ex. sort=desc or sort[]=asc&sort[]=desc).
Default value: asc
'limit': 8.14, // {BigDecimal} Change the number of results returned, max is 10000.
Default value: 100
'page': 8.14 // {BigDecimal} aginate through results.
Default value: 1
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.cities(apiecoKey, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class citiesExample
{
public void main()
{
// Configure API key authorization: apieco-key
Configuration.Default.ApiKey.Add("apieco-key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.ApiKeyPrefix.Add("apieco-key", "Bearer");
var apiInstance = new CitiesApi();
var apiecoKey = apiecoKey_example; // String |
var country = country_example; // String | Limit results by a certain country. (optional)
var orderBy = new array[String](); // array[String] | Order by one or more fields (ex. order_by=country or order_by[]=country&order_by[]=locations).
Default value: country (optional)
var sort = new array[String](); // array[String] | Define sort order for one or more fields (ex. sort=desc or sort[]=asc&sort[]=desc).
Default value: asc (optional)
var limit = 8.14; // BigDecimal | Change the number of results returned, max is 10000.
Default value: 100 (optional)
var page = 8.14; // BigDecimal | aginate through results.
Default value: 1 (optional)
try
{
inline_response_200 result = apiInstance.cities(apiecoKey, country, orderBy, sort, limit, page);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling CitiesApi.cities: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: apieco-key
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('apieco-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apieco-key', 'Bearer');
$api_instance = new Swagger\Client\Api\CitiesApi();
$apiecoKey = apiecoKey_example; // String |
$country = country_example; // String | Limit results by a certain country.
$orderBy = ; // array[String] | Order by one or more fields (ex. order_by=country or order_by[]=country&order_by[]=locations).
Default value: country
$sort = ; // array[String] | Define sort order for one or more fields (ex. sort=desc or sort[]=asc&sort[]=desc).
Default value: asc
$limit = 8.14; // BigDecimal | Change the number of results returned, max is 10000.
Default value: 100
$page = 8.14; // BigDecimal | aginate through results.
Default value: 1
try {
$result = $api_instance->cities($apiecoKey, $country, $orderBy, $sort, $limit, $page);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CitiesApi->cities: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::CitiesApi;
# Configure API key authorization: apieco-key
$WWW::SwaggerClient::Configuration::api_key->{'apieco-key'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'apieco-key'} = "Bearer";
my $api_instance = WWW::SwaggerClient::CitiesApi->new();
my $apiecoKey = apiecoKey_example; # String |
my $country = country_example; # String | Limit results by a certain country.
my $orderBy = []; # array[String] | Order by one or more fields (ex. order_by=country or order_by[]=country&order_by[]=locations).
Default value: country
my $sort = []; # array[String] | Define sort order for one or more fields (ex. sort=desc or sort[]=asc&sort[]=desc).
Default value: asc
my $limit = 8.14; # BigDecimal | Change the number of results returned, max is 10000.
Default value: 100
my $page = 8.14; # BigDecimal | aginate through results.
Default value: 1
eval {
my $result = $api_instance->cities(apiecoKey => $apiecoKey, country => $country, orderBy => $orderBy, sort => $sort, limit => $limit, page => $page);
print Dumper($result);
};
if ($@) {
warn "Exception when calling CitiesApi->cities: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: apieco-key
swagger_client.configuration.api_key['apieco-key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# swagger_client.configuration.api_key_prefix['apieco-key'] = 'Bearer'
# create an instance of the API class
api_instance = swagger_client.CitiesApi()
apiecoKey = apiecoKey_example # String |
country = country_example # String | Limit results by a certain country. (optional)
orderBy = # array[String] | Order by one or more fields (ex. order_by=country or order_by[]=country&order_by[]=locations).
Default value: country (optional)
sort = # array[String] | Define sort order for one or more fields (ex. sort=desc or sort[]=asc&sort[]=desc).
Default value: asc (optional)
limit = 8.14 # BigDecimal | Change the number of results returned, max is 10000.
Default value: 100 (optional)
page = 8.14 # BigDecimal | aginate through results.
Default value: 1 (optional)
try:
api_response = api_instance.cities(apiecoKey, country=country, orderBy=orderBy, sort=sort, limit=limit, page=page)
pprint(api_response)
except ApiException as e:
print("Exception when calling CitiesApi->cities: %s\n" % e)
Parameters
Name | Description |
---|---|
apieco-key* |
String
Required
|
Name | Description |
---|---|
country |
String
Limit results by a certain country.
|
order_by |
array[String]
Order by one or more fields (ex. order_by=country or order_by[]=country&order_by[]=locations).
Default value: country
|
sort |
array[String]
Define sort order for one or more fields (ex. sort=desc or sort[]=asc&sort[]=desc).
Default value: asc
|
limit |
BigDecimal
Change the number of results returned, max is 10000.
Default value: 100
|
page |
BigDecimal
aginate through results.
Default value: 1
|