Java Integration

It is easy to use the GoodGrids API with Java to convert CSV files into Excel spreadsheets. You can create an Excel file from a CSV file with this simple snippet of code:

public void convertCSVToExcelUsingGoodGrids()
  throws ClientProtocolException, IOException
    CloseableHttpClient client = HttpClients.createDefault();
    String goodGridsAPIUrl = "";
    HttpPost httpPost = new HttpPost(goodGridsAPIUrl);

    MultipartEntityBuilder builder = MultipartEntityBuilder.create();
    builder.addBinaryBody("file", new File("to_convert.csv"),
      ContentType.APPLICATION_OCTET_STREAM, "to_convert.csv");

    HttpEntity multipart =;

    CloseableHttpResponse response = client.execute(httpPost);
    assertThat(response.getStatusLine().getStatusCode(), equalTo(200));

Make sure to set goodGridsAPIUrl to the API URL of the CSV-to-Excel conversion configuration you want to use.

This snippet of code uses the Apache HttpClient 4 for the API request. You can adapt this code to use whichever client library you want.

Found a bug? Have a suggestion on how to improve this documentation? Please send us a note at