Skip to content

Resource CountryResource

CrucifiedPain edited this page Jun 26, 2026 · 9 revisions

CountryResource (client.country)

Endpoints: • country.getCountryById • country.getAllCountries

.find_by_name()

Client-side helper: return the country matching name (case-insensitive).

Returns None if no country with that name exists.

Signature

await client.country.find_by_name(name: 'str') -> 'Country | None'

Parameters

Name Type Default
name str *Required*

Return Models

Country

Field Type Required Description
_id string Optional
__v integer Optional
name string Optional The official name of the country.
code string Optional The code.
money number Optional The money.
scheme string Optional The scheme.
mapAccent string Optional The map accent.
discordUrl string Optional The discord url.
specializedItem string Optional The specialized item.
pinnedArticle string Optional The pinned article.
currentBattleOrder string Optional The current battle order.
rulingParty string Optional The ruling party.
allianceId string Optional The alliance id.
enemy string Optional The enemy.
allies array[string] Optional A list of country UUIDs that share a Mutual Protection Pact (MPP) with this country.
warsWith array[string] Optional A list of country UUIDs this country is currently at war with.
defensivePacts array[string] Optional A list of country UUIDs offering defensive guarantees.
orgs array[string] Optional The orgs.
nonAggressionUntil object Optional The non aggression until.
development number Optional The development.
currentDevelopment number Optional The current development.
averageDevelopment number Optional The average development.
coreDevelopment number Optional The core development.
currentPopulation integer Optional The current population.
taxes CountryTaxes Optional The various tax rates applied to economic activities within the country.
unrest CountryUnrest Optional The unrest.
strategicResources CountryStrategicResources Optional The strategic resources.
rankings CountryRankings Optional The country's current standing in the global leaderboards.
createdAt string Optional The timestamp when this record was created.
updatedAt string Optional The timestamp when this record was last modified.

CountryRankings

Field Type Required Description
_id string Optional
__v integer Optional
countryRegionDiff RankingDetail Optional The country region diff.
countryDamages RankingDetail Optional The country damages.
weeklyCountryDamages RankingDetail Optional The weekly country damages.
weeklyCountryDamagesPerCitizen RankingDetail Optional The weekly country damages per citizen.
countryDevelopment RankingDetail Optional The country development.
countryActivePopulation RankingDetail Optional The country active population.
countryWealth RankingDetail Optional The country wealth.
countryBounty RankingDetail Optional The country bounty.
countryProductionBonus RankingDetail Optional The country production bonus.

CountryStrategicBonuses

Field Type Required Description
_id string Optional
__v integer Optional
productionPercent number Optional The production percent.
developmentPercent number Optional The development percent.

CountryStrategicResourceMap

Region IDs holding each strategic resource.

Field Type Required Description
_id string Optional
__v integer Optional
coal array[string] Optional The coal.
diamonds array[string] Optional The diamonds.
gold array[string] Optional The gold.
lithium array[string] Optional The lithium.
rareEarths array[string] Optional The rare earths.
uranium array[string] Optional The uranium.

CountryStrategicResources

Field Type Required Description
_id string Optional
__v integer Optional
resources CountryStrategicResourceMap Optional The resources.
bonuses CountryStrategicBonuses Optional The bonuses.

CountryTaxes

Field Type Required Description
_id string Optional
__v integer Optional
income number Optional The income.
market number Optional The market.
selfWork number Optional The tax rate applied when a user works for their own companies.

CountryUnrest

Field Type Required Description
_id string Optional
__v integer Optional
bar number Optional The bar.
barMax number Optional The bar max.
lastContributionAt string Optional The timestamp of the last contribution event.

RankingDetail

Field Type Required Description
_id string Optional
__v integer Optional
value number Optional The value.
rank integer Optional The rank.
tier string Optional The tier.
country string Optional The UUID of the country this user holds citizenship in.

.get()

Get a single country by ID.

Signature

await client.country.get(country_id: 'str') -> 'Country'

Parameters

Name Type Default
country_id str *Required*

Return Models

Country

Field Type Required Description
_id string Optional
__v integer Optional
name string Optional The official name of the country.
code string Optional The code.
money number Optional The money.
scheme string Optional The scheme.
mapAccent string Optional The map accent.
discordUrl string Optional The discord url.
specializedItem string Optional The specialized item.
pinnedArticle string Optional The pinned article.
currentBattleOrder string Optional The current battle order.
rulingParty string Optional The ruling party.
allianceId string Optional The alliance id.
enemy string Optional The enemy.
allies array[string] Optional A list of country UUIDs that share a Mutual Protection Pact (MPP) with this country.
warsWith array[string] Optional A list of country UUIDs this country is currently at war with.
defensivePacts array[string] Optional A list of country UUIDs offering defensive guarantees.
orgs array[string] Optional The orgs.
nonAggressionUntil object Optional The non aggression until.
development number Optional The development.
currentDevelopment number Optional The current development.
averageDevelopment number Optional The average development.
coreDevelopment number Optional The core development.
currentPopulation integer Optional The current population.
taxes CountryTaxes Optional The various tax rates applied to economic activities within the country.
unrest CountryUnrest Optional The unrest.
strategicResources CountryStrategicResources Optional The strategic resources.
rankings CountryRankings Optional The country's current standing in the global leaderboards.
createdAt string Optional The timestamp when this record was created.
updatedAt string Optional The timestamp when this record was last modified.

CountryRankings

Field Type Required Description
_id string Optional
__v integer Optional
countryRegionDiff RankingDetail Optional The country region diff.
countryDamages RankingDetail Optional The country damages.
weeklyCountryDamages RankingDetail Optional The weekly country damages.
weeklyCountryDamagesPerCitizen RankingDetail Optional The weekly country damages per citizen.
countryDevelopment RankingDetail Optional The country development.
countryActivePopulation RankingDetail Optional The country active population.
countryWealth RankingDetail Optional The country wealth.
countryBounty RankingDetail Optional The country bounty.
countryProductionBonus RankingDetail Optional The country production bonus.

CountryStrategicBonuses

Field Type Required Description
_id string Optional
__v integer Optional
productionPercent number Optional The production percent.
developmentPercent number Optional The development percent.

CountryStrategicResourceMap

Region IDs holding each strategic resource.

Field Type Required Description
_id string Optional
__v integer Optional
coal array[string] Optional The coal.
diamonds array[string] Optional The diamonds.
gold array[string] Optional The gold.
lithium array[string] Optional The lithium.
rareEarths array[string] Optional The rare earths.
uranium array[string] Optional The uranium.

CountryStrategicResources

Field Type Required Description
_id string Optional
__v integer Optional
resources CountryStrategicResourceMap Optional The resources.
bonuses CountryStrategicBonuses Optional The bonuses.

CountryTaxes

Field Type Required Description
_id string Optional
__v integer Optional
income number Optional The income.
market number Optional The market.
selfWork number Optional The tax rate applied when a user works for their own companies.

CountryUnrest

Field Type Required Description
_id string Optional
__v integer Optional
bar number Optional The bar.
barMax number Optional The bar max.
lastContributionAt string Optional The timestamp of the last contribution event.

RankingDetail

Field Type Required Description
_id string Optional
__v integer Optional
value number Optional The value.
rank integer Optional The rank.
tier string Optional The tier.
country string Optional The UUID of the country this user holds citizenship in.

.get_all()

Get all countries. Returns a dict keyed by country ID for O(1) lookups.

Signature

await client.country.get_all() -> 'dict[str, Country]'

Return Models

Country

Field Type Required Description
_id string Optional
__v integer Optional
name string Optional The official name of the country.
code string Optional The code.
money number Optional The money.
scheme string Optional The scheme.
mapAccent string Optional The map accent.
discordUrl string Optional The discord url.
specializedItem string Optional The specialized item.
pinnedArticle string Optional The pinned article.
currentBattleOrder string Optional The current battle order.
rulingParty string Optional The ruling party.
allianceId string Optional The alliance id.
enemy string Optional The enemy.
allies array[string] Optional A list of country UUIDs that share a Mutual Protection Pact (MPP) with this country.
warsWith array[string] Optional A list of country UUIDs this country is currently at war with.
defensivePacts array[string] Optional A list of country UUIDs offering defensive guarantees.
orgs array[string] Optional The orgs.
nonAggressionUntil object Optional The non aggression until.
development number Optional The development.
currentDevelopment number Optional The current development.
averageDevelopment number Optional The average development.
coreDevelopment number Optional The core development.
currentPopulation integer Optional The current population.
taxes CountryTaxes Optional The various tax rates applied to economic activities within the country.
unrest CountryUnrest Optional The unrest.
strategicResources CountryStrategicResources Optional The strategic resources.
rankings CountryRankings Optional The country's current standing in the global leaderboards.
createdAt string Optional The timestamp when this record was created.
updatedAt string Optional The timestamp when this record was last modified.

CountryRankings

Field Type Required Description
_id string Optional
__v integer Optional
countryRegionDiff RankingDetail Optional The country region diff.
countryDamages RankingDetail Optional The country damages.
weeklyCountryDamages RankingDetail Optional The weekly country damages.
weeklyCountryDamagesPerCitizen RankingDetail Optional The weekly country damages per citizen.
countryDevelopment RankingDetail Optional The country development.
countryActivePopulation RankingDetail Optional The country active population.
countryWealth RankingDetail Optional The country wealth.
countryBounty RankingDetail Optional The country bounty.
countryProductionBonus RankingDetail Optional The country production bonus.

CountryStrategicBonuses

Field Type Required Description
_id string Optional
__v integer Optional
productionPercent number Optional The production percent.
developmentPercent number Optional The development percent.

CountryStrategicResourceMap

Region IDs holding each strategic resource.

Field Type Required Description
_id string Optional
__v integer Optional
coal array[string] Optional The coal.
diamonds array[string] Optional The diamonds.
gold array[string] Optional The gold.
lithium array[string] Optional The lithium.
rareEarths array[string] Optional The rare earths.
uranium array[string] Optional The uranium.

CountryStrategicResources

Field Type Required Description
_id string Optional
__v integer Optional
resources CountryStrategicResourceMap Optional The resources.
bonuses CountryStrategicBonuses Optional The bonuses.

CountryTaxes

Field Type Required Description
_id string Optional
__v integer Optional
income number Optional The income.
market number Optional The market.
selfWork number Optional The tax rate applied when a user works for their own companies.

CountryUnrest

Field Type Required Description
_id string Optional
__v integer Optional
bar number Optional The bar.
barMax number Optional The bar max.
lastContributionAt string Optional The timestamp of the last contribution event.

RankingDetail

Field Type Required Description
_id string Optional
__v integer Optional
value number Optional The value.
rank integer Optional The rank.
tier string Optional The tier.
country string Optional The UUID of the country this user holds citizenship in.

.invalidate_cache()

Clear the SWR cache for all resources.

Signature

await client.country.invalidate_cache() -> 'None'

Clone this wiki locally