log in

Api

We also offer an API service. JSON text may be converted to CSV on demand.

We allow 1 MB per day to be converted via the API for free (contact us if you need more than this). We would also appreciate it if you would mention us on your website if that is possible.

Register here to access the API:

required

After you have registered, the following illustrates how you would process an automatic conversion using PHP or C#:



PHP Sample Code


    $url = 'https://json-csv.com/api/getcsv';
    $email = 'youremail@here.com';
    $json = '{"test":true,"test2":false}';

    $postdata = http_build_query(
      array(
        'email' => $email,
        'json' => $json
      )
    );

    $opts = array(
      'http' => array(
        'method'  => 'POST',
        'header'  => 'Content-type: application/x-www-form-urlencoded',
        'content' => $postdata
      )
    );
    $context  = stream_context_create($opts);
    $result = file_get_contents($url, false, $context);

    print $result;



C# Sample Code

    
    string email = "youremail@here.com";
    string json = "{\"test\":true,\"test2\":false}";
    using (var client = new HttpClient())
    {
        string url = "https://json-csv.com/api/getcsv";
        var content = new FormUrlEncodedContent(new[] 
        {
            new KeyValuePair("email", email),
            new KeyValuePair("json", json),
        });
        var result = client.PostAsync(url, content).Result;
        string csvContent = result.Content.ReadAsStringAsync().Result;
        Response.Write(csvContent);
    }

Please contact us for further information