Setup
To fetch the achievement data of the World of Warcraft character we are going to make use of armoryapi, the armoryapi library currently requires that the project’s target framework be 3.5 or higher so set your project up to use 3.5 or higher in the project properties.
After creating your project and setting up the target framework the next step is to add the reference to the armoryapi library. Download and extract the latest armoryapi package and you will find a DLL and an XML file inside, make note of where you have extracted these files and head back to Visual Studio. Open the “Add Reference” dialog (see http://msdn.microsoft.com/en-us/library/wkze6zky(v=vs.80).aspx) and click the tab labelled “Browse” and navigate to the armoryapi DLL that you extracted.
Note: in order for the intellisense documentation to work you must also extract the XML file to the same directory as the DLL
Code
Now that your project is setup let’s get started with some code, first thing’s first let’s create a very simple form that we can use to fetch and display the data. Create a form and add the following controls:
characterNameTextBox – TextBox
realmTextBox – TextBox
achievementList – ListBox
fetchButton – Button
You should now have something similar to this (I have added a few labels and a groupbox, but you obviously don’t have to do this to get started):

Now that we have our GUI sorted double click on fetchButton to create the click event handler for the button. Once you are in the code view we need to add an import to the ArmoryAPI namespace, to do this add the following line at the top of the file:
VB.Net
Imports ArmoryAPI
C#
using ArmoryAPI;
Once you’ve added the namespace import go back to the event handler for the button click and add the following code:
VB.Net
Dim armory As Armory = New Armory(BattleNetRegion.Europe, BattleNetLocale.en_GB)
Dim character As Character = armory.GetCharacter(characterNameTextBox.Text, realmTextBox.Text)
For Each a As UnlockedAchievement In character.Achievements
If (DateTime.Now.AddDays(-14) < a.Unlocked) Then
achievementList.Items.Add(String.Format("{0} ({1} points)", a.Title, a.Points))
End If
Next
C#
Armory armory = new Armory(BattleNetRegion.Europe, BattleNetLocale.en_GB);
Character character = armory.GetCharacter(characterNameTextBox.Text, realmTextBox.Text);
foreach (UnlockedAchievement a in character.Achievements)
{
if (DateTime.Now.AddDays(-14) < a.Unlocked)
{
achievementList.Items.Add(String.Format("{0} ({1} points)", a.Title, a.Points));
}
}
If you debug the project now you will be able to fetch the achievements the character entered has unlocked within the last two weeks as can be seen below.

This code queries the European servers and returns the data in English, if you need a different configuration simply change the line that creates the Armory object, the following regions and locales are supported:
Regions
- America
- China
- Europe
- Korea
- Taiwan
Locales
- de_DE
- en_GB
- en_US
- es_ES
- es_MX
- fr_FR
- ko_KR
- ru_RU
- zh_CN
- zh_TW
Extra Steps
In order to improve upon this project, you can utiilise the caching functionality of armoryapi, to do this you’ll have to setup a database (see http://code.google.com/p/armoryapi/wiki/GettingStarted#Setting_up_a_Database) and simply pass the connection string to the Armory object and the time in minutes that the data should be cached for as shown in the example below.
armory.ConnectionString = "Data Source=(local)\SQLEXPRESS;Initial Catalog=armoryapi;User ID=username;Password=password"
armory.RefreshInterval = 120