Please upgrade your browser to make full use of this site.  chrome

API v0.1 Alpha

2 May 2018 Update: v0.1 has been depricated

API v0.2 Alpha

Please note, the CryptoCities API is in an Alpha release and is still subject to change.

You Need A Key

When calling the API you will need to use your own API key. This key currently allows you to make 100 calls every 10 mins. Please contact us to get your key - you may use the test key below, although you will be sharing it's rate limit with everyone else using it. All API calls must have the key provided in the querystring.

?key=C5378d2b81A3C0E8998F29b604cf4BDf455916C5
..or..
&key=C5378d2b81A3C0E8998F29b604cf4BDf455916C5

The Location Entity

Most endpoints will return a single location entity, or a collection of location entities. Below is an example response.

Endpoints

All endoints are reachable via the main domain (you can test this in your browser). eg:

https://cryptocities.net/api/v1/locations?key=C5378d2b81A3C0E8998F29b604cf4BDf455916C5

Location Endpoint

/api/v1/locations/[LOCATION_ID]   example

Returns the specific location

Listing Endpoints

Multiple listing endpoints are currently available for browsing all locations.

/api/v1/locations/   example

Locations by descending location_id

/api/v1/locations/oldest   example

Locations by ascending location_id

/api/v1/locations/smallest   example

Locations by ascending points

/api/v1/locations/biggest   example

Locations by descending points

/api/v1/locations/cheapest   example

Locations by ascending price

/api/v1/locations/expensive   example

Locations by descending price

/api/v1/locations/cheapest_ppp   example

Locations by ascending price per point

/api/v1/locations/expensive_ppp   example

Locations by descending price per point

Listing Options

Locations can be filtered using the following querystring parameters:

count=[NUMBER]   example

Limit the number of locations returned between 1 and 100

owner=[ADDRESS]   example

Locations owned by an address

country=[COUNTRY]   example

Locations within a specific country, eg. US, GB, CA

points_low=[POINTS]   example

Locations with points greater than and including this value

points_high=[POINTS]   example

Locations with points lower than and including this value

below_id=[LOCATION_ID]   example

Locations with location_id's lower than this value

above_id=[LOCATION_ID]   example

Locations with location_id's higher than this value

Location Ownership

All locations will be under the control of its owner or the person it's being rented to. It could also be under the control of another location if it is being used to enhance that location. This is referred to as 'embedding' in the API.

belongs_to

This can currently be set to 3 different values depending on who controls the location:
owner: The location is under the control of the owner
renter: The location is under the control of the renter
embeder: The location is being used to enhance another location

Location Info

All locations will return the following fields.

id

Every location is uniquely identifiable by its id

name

Currently the English equivalent name for the location

ccode

The ISO Alpha-2 country code for the location, eg. GB, US, CA, FR, CN, RU

country

The English equivalent name for country

embeded_to

If the location is embedded in another (enhancing another) then this will provide the id of the other location. (0 if not embeded)

points

The total points for the location. This includes it basic points obtained when it was discovered as well as any enhanced points it has.

pts_basic

The basic points obtained during discovery (1 - 50)

pts_embed

Any points provided by other embedded locations.

owner

The address that owns this location. This could also be another contract.

features

A list of the game features the location has.

buy

If this location has been listed for sale then this is the ETH price to buy it.

lat, lng

The latitude and longitude for the location.

rarity

This is an experimental measure of the location's rarity.

capital

This is true if the location is a capital city.