Parsing a JSON file - NYT API

Hey all,

I am trying to use the NYT api following this tutorial

It seems that when i try to grab the total from the array it says it cannot be found, any ideas as wtp why?

import org.json.JSONException;

String apiKey ="4lASP4sV0QO82ITouhBX5mYXSKkH1gNK";

String baseURL = "";

void setup() {

void getOJArticles() {

String request = baseURL + "?query=O.J.+Simpson&begin_date=19940101&end_date=19960101&api-key=" + apiKey;

String result = join( loadStrings( request ), "");

  JSONObject nytData = loadJSONObject(request);
  JSONArray results = nytData.getJSONArray("results");
  int total = nytData.getInt("total");
  println("There were "+total+" occurences of the term O.J Simpson in 1994-1995");
} finally {}