Revision history for APIOverview
Additions:
Libraries Codebase: http://code.google.com/p/pvsapi-lib/
Mailing List: http://groups.google.com/group/pvsapi
Mailing List: http://groups.google.com/group/pvsapi
Additions:
===General Info===
Load Balancer IP: 66.70.26.25 (Forwarded to port 81 on respective servers)
Load Balancer IP: 66.70.26.25 (Forwarded to port 81 on respective servers)
Deletions:
==Supplied Libraries==
//Coming Soon//
==Supplied Widgets==
//Coming Soon//
==Direct Interaction==
If we don't have a library for your native language or you feel the need to directly interact with our backend portion of the API, you can. It takes a little more technical knowhow but it can be worth it. It works very similar to our libraries. You supply the same information and get the same type of data in return. Even the methods are named pretty much the same.
__Example__
You would like to get the votes for a bill's action(stage). You would write code similar to this(example is in PHP).
//Example coming soon//
%%http://api.votesmart.org/Votes.getBillActionVotes?key=14fc970344e42f6efc67024531f0e0a5&act_id=13423&o=XML%%
First you have the hostname(duh) of **api.votesmart.org**
Second is the object and method names **Votes.getBillActionVotes**
After these are input determining what you will receive back.
The **key** variable is the key you were provided during registration. This is your machine's unique identifier so we know where the request is coming from and that they are authorized to do so. Each key is tied to one of our registrant's machines.
**act_id** is the action ID. This is the only criteria necessary for this method. You would normally get an action ID from another method.
**o** stands for __output__. This tells our system what format you would like your data in. We currently support XML and JSON. If this variable is not specified, it defaults to XML.
Here is sample output of this query. **NOTE**: Some output was truncated due to length.
==XML==
%%<?xml version="1.0" encoding="UTF-8"?>
<votes>
<generalinfo>
<title>Project Vote Smart - Keyvotes - S Amdt 1150 - Immigration Reform Substitute Amendment</title>
<linkback>http://votesmart.org/issue_keyvote_member.php?cs_id=13423</linkback>
</generalinfo>
<vote>
<candidateid>53286</candidateid>
<candidatename>Akaka, Daniel Kahikina</candidatename>
<action>Yea</action>
</vote>
<vote>
<candidateid>15691</candidateid>
<candidatename>Alexander, Lamar</candidatename>
<action>Nay</action>
</vote>
<vote>
<candidateid>26783</candidateid>
<candidatename>Allard, Wayne</candidatename>
<action>Nay</action>
</vote>
<vote>
<candidateid>53315</candidateid>
<candidatename>Baucus, Max</candidatename>
<action>Nay</action>
</vote>
[...]
<vote>
<candidateid>27036</candidateid>
<candidatename>Wyden, Ron</candidatename>
<action>Yea</action>
</vote>
</votes>%%
==JSON==
%%{
votes: {
generalinfo: {
"title": "Project Vote Smart - Keyvotes - S Amdt 1150 - Immigration Reform Substitute Amendment",
"linkback": "http://votesmart.org/issue_keyvote_member.php?cs_id=13423"
}
vote: {
"candidateid": "53286",
"candidatename": "Akaka, Daniel Kahikina",
"action": "Yea"
}
vote: {
"candidateid": "15691",
"candidatename": "Alexander, Lamar",
"action": "Nay"
}
vote: {
"candidateid": "26783",
"candidatename": "Allard, Wayne",
"action": "Nay"
}
vote: {
"candidateid": "53315",
"candidatename": "Baucus, Max",
"action": "Nay"
}
[...]
vote: {
"candidateid": "27036",
"candidatename": "Wyden, Ron",
"action": "Yea"
}
}
}%%
Additions:
==Supplied Widgets==
Additions:
==XML==
==JSON==
%%{
votes: {
generalinfo: {
"title": "Project Vote Smart - Keyvotes - S Amdt 1150 - Immigration Reform Substitute Amendment",
"linkback": "http://votesmart.org/issue_keyvote_member.php?cs_id=13423"
}
vote: {
"candidateid": "53286",
"candidatename": "Akaka, Daniel Kahikina",
"action": "Yea"
}
vote: {
"candidateid": "15691",
"candidatename": "Alexander, Lamar",
"action": "Nay"
}
vote: {
"candidateid": "26783",
"candidatename": "Allard, Wayne",
"action": "Nay"
}
vote: {
"candidateid": "53315",
"candidatename": "Baucus, Max",
"action": "Nay"
}
[...]
vote: {
"candidateid": "27036",
"candidatename": "Wyden, Ron",
"action": "Yea"
}
}
}%%
==JSON==
%%{
votes: {
generalinfo: {
"title": "Project Vote Smart - Keyvotes - S Amdt 1150 - Immigration Reform Substitute Amendment",
"linkback": "http://votesmart.org/issue_keyvote_member.php?cs_id=13423"
}
vote: {
"candidateid": "53286",
"candidatename": "Akaka, Daniel Kahikina",
"action": "Yea"
}
vote: {
"candidateid": "15691",
"candidatename": "Alexander, Lamar",
"action": "Nay"
}
vote: {
"candidateid": "26783",
"candidatename": "Allard, Wayne",
"action": "Nay"
}
vote: {
"candidateid": "53315",
"candidatename": "Baucus, Max",
"action": "Nay"
}
[...]
vote: {
"candidateid": "27036",
"candidatename": "Wyden, Ron",
"action": "Yea"
}
}
}%%
No Differences
Additions:
%%http://api.votesmart.org/Votes.getBillActionVotes?key=14fc970344e42f6efc67024531f0e0a5&act_id=13423&o=XML%%