{"id":37026188,"url":"https://github.com/agadar/nationstates-api-java-wrapper","last_synced_at":"2026-01-14T03:02:31.126Z","repository":{"id":57727698,"uuid":"62467929","full_name":"Agadar/NationStates-API-Java-Wrapper","owner":"Agadar","description":"A Java library for consuming the NationStates API.","archived":false,"fork":false,"pushed_at":"2023-06-13T07:05:08.000Z","size":534,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-01T23:36:01.424Z","etag":null,"topics":["library","nationstates"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Agadar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-02T20:07:21.000Z","updated_at":"2022-05-05T10:29:23.000Z","dependencies_parsed_at":"2022-08-30T06:01:16.877Z","dependency_job_id":null,"html_url":"https://github.com/Agadar/NationStates-API-Java-Wrapper","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/Agadar/NationStates-API-Java-Wrapper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Agadar%2FNationStates-API-Java-Wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Agadar%2FNationStates-API-Java-Wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Agadar%2FNationStates-API-Java-Wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Agadar%2FNationStates-API-Java-Wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Agadar","download_url":"https://codeload.github.com/Agadar/NationStates-API-Java-Wrapper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Agadar%2FNationStates-API-Java-Wrapper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408800,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["library","nationstates"],"created_at":"2026-01-14T03:02:29.400Z","updated_at":"2026-01-14T03:02:31.087Z","avatar_url":"https://github.com/Agadar.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Agadar's Java Wrapper for the NationStates API.\n\nThis Java library provides programmers with an easy way to communicate with the NationStates API. \n\nIt supports the following basic functionalities:\n* Retrieving information about Nations, Regions, the World Assembly, and the World;\n* Downloading and reading daily data dumps;\n* Sending telegrams;\n* Verifying users.\n\nOn top of the basic functionalities, this wrapper also ensures the mandated rate limits are not violated, and gives warnings when\nthe wrapper itself is outdated, so that you don't have to worry about any of those things.\n\n## Usage\n\n### Basics\n\nInstantiating a NationStates object and setting a User Agent is the first thing you'll have to do, ensuring NationStates admins can identify your script:\n\n```\nNationStates nationStates = new DefaultNationStatesImpl(\"Example Nation's Script (example@example.com)\");\n```\n\nThat's all you need to do to be able to use the wrapper! Now we can, say, retrieve the national animal name of a nation:\n\n```\nNation nation = nationStates.getNation(\"agadar\").shards(NationShard.ANIMAL).execute();\n```\n\nThis gives us a Nation object holding the animal name. That's all there is to it! All queries are build and executed in a similar \nfashion.\n\n### Custom return types\n\nThe 'Nation' class and other such domain classes have little to no methods: they exist solely to hold the information you request \nfrom the NationStates API. If you want to add methods, then you can inherit the domain classes or create entirely seperate ones and tell the wrapper to use your custom domain classes instead.\n\nFor example, imagine we create a class 'CustomNation' that inherits 'Nation' but which holds some handy methods not natively present in the 'Nation' class. We then first register our custom class so that it is recognized:\n\n```\nnationStates.registerTypes(CustomNation.class);\n```\n\nNow whenever we want a Nation-query to return our custom type, we can use the overloaded execute()-function, like so:\n\n```\nCustomNation nation = nationStates.getNation(\"agadar\").shards(NationShard.ANIMAL).execute(CustomNation.class);\n```\n\nAnd voilà: we now have an instance of our custom class, holding the retrieved animal name.\n\n## Links\n\n[NationStates forum thread](http://forum.nationstates.net/viewtopic.php?f=15\u0026t=383518)\n\n[Official NationStates website](http://www.nationstates.net/)\n\n[NationStates API documentation](https://www.nationstates.net/pages/api.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagadar%2Fnationstates-api-java-wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagadar%2Fnationstates-api-java-wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagadar%2Fnationstates-api-java-wrapper/lists"}