get https://watsi.org/fund-treatments.json
Calling /fund-treatments.json
will return a list of all currently fundable patients on Watsi.
key | description |
---|---|
profiles | This will be an array of all fundable profiles on Watsi. |
Each profile will have the following keys:
Key | Value (Example) | Description |
---|---|---|
token | String ("69a1b67ff206") | The token of the profile (use the /profile/:token endpoint to get additional details) |
name | String ("Julie") | The first name of the patient |
header | String | A short, descriptive sentence about the patient. |
age_years | Integer (13) | The age of the patient, in years. If the patient is younger than 2, may be blank. |
age_months | Integer (2) | How many months the patient has lived past the age_years parameter; for example, if age_years is 1 and age_months is 6, the patient is 1 year, 6 months, or 18 months, old. If the patients is older than 2 years old, may be blank. |
partner_name | String | The name of the Watsi medical partner performing the medical procedure |
country | String ("Nepal") | The country the medical procedure will be taking place in |
url | String | The Watsi URL for this profile; normally in the format of /profile/[token]-[name] |
photo_url | String | An image of the patient. This image is guaranteed to have a 4:3 width:height ratio; currently, the image returned is always 638x479. |
percent_funded | Float (0.19) | A float between 0 and 1 representing the percent that the patient has been funded. |
target_amount | Float (600) | The cost of the medical procedure that the patient is fundraising for. |
amount_remaining | Float (324.5) | How much of the cost that has not yet been funded by donors. |
amount_raised | Float (275.5) | How much of the cost has already been raised. |
number_of_donors | Integer (6) | The number of donors who have already contributed to this patient's medical procedure. |
Here's some examples on how to request the data:
require 'open-uri'
require 'json'
patients = JSON.parse(open("https://watsi.org/fund-treatments.json").read)
# You'll need to install requests
import requests
r = requests.get('https://watsi.org/fund-treatments.json')
patients = r.json()
var request = require('request');
request.get('https://watsi.org/fund-treatments.json', {
json: true
}, function(err, res, patients) {
console.log("Patients!", patients);
});