Sample Code

Below bluk correction api service can be redeemed. To check pricing details and buy plan suitable for you. Click Here

1. Bulk Correction In C#

In C# bulk Correction API can be accessed by using following Code:

Code Sample

using System;
using System.IO;
using System.Net;
using System.Text;
class MainClass
{
    public static void Main (string[] args)
    {
        // note: Use "region_code":"USA" for USA or "region_code":"CAN" for Canada                            
        String Request = "{\"region_code\":\"enter_your_region\",\"api_key\":\"your_api_key_here\",\"address\":[[\"Case1\",\"564 HELIGAN LN #1q\",\"\",\"LIVERMORE\",\"CA\",\"94551\"]]}";
        HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:3032/SACAPI/bulkFromCode");
        request.ContentType = "application/x-www-form-urlencoded";
        request.Method = "POST";
        byte[] byteArray = Encoding.UTF8.GetBytes(Request);
        request.ContentLength = byteArray.Length;
        Stream dataStream = request.GetRequestStream();
        dataStream.Write(byteArray, 0, byteArray.Length);
        WebResponse response = request.GetResponse();
        dataStream = response.GetResponseStream();
        StreamReader reader = new StreamReader(dataStream);
        string Response = reader.ReadToEnd();
        Console.WriteLine(Response);
        dataStream.Close();
        Console.ReadLine();
    }
}

2. Bulk Correction In Java

In Java bulk Correction API can be accessed by using following Code:

Code Sample

import java.net.*;
import java.io.*;
public class Test {
    public static void main(String[] args) throws MalformedURLException,IOException
    {
        // note: Use "region_code":"USA" for USA or "region_code":"CAN" for Canada                            
        String data = "{\"region_code\":\"enter_your_region\",\"api_key\":\"your_api_key_here\",\"address\":[[\"Case1\",\"564 HELIGAN LN #1q\",\"\",\"LIVERMORE\",\"CA\",\"94551\"]]}";
        byte[] bytesData = data.getBytes();
        URL url = new URL("https://www.fixaddress.com/SACAPI/bulkFromCode");
        HttpURLConnection conn = (HttpURLConnection) url.openConnection();
        conn.setDoOutput(true);
        conn.setReadTimeout(60000);
        conn.setRequestProperty("Content-Type", "application/octet-stream");
        conn.setRequestProperty("data", data);
        OutputStream out = conn.getOutputStream();
        out.write(bytesData);
        out.flush();
        BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream()));
        String output;
        while ((output = br.readLine()) != null) {
            System.out.println(output);
        }
    }
}

3. Bulk Correction In Python

In Python bulk Correction API can be accessed by using following Code:

Code Sample

import json
import urllib.request
import urllib
from urllib.parse import urlencode
from urllib.request import Request, urlopen
# Use "region_code":"USA" for USA or "region_code":"CAN" for Canada                                    
url = "https://www.fixaddress.com/SACAPI/bulkFromCode";
data = '{"region_code":"enter_your_region","api_key":"your_api_key_here","address":[["Case1","564 HELIGAN LN #1q","","LIVERMORE","CA","94551"]]}';
request = Request(url, data.encode())
res = urlopen(request).read().decode()
print(res)