Get API Usage (v2)

GET /v2/getapiusage

API URL: https://api.zerobounce.net/v2/getapiusage

URL Parameters

  • Parameter
    Description
  • api_key
    Your API Key, found in your account.
  • start_date
    The start date of when you want to view API usage. (format: yyyy/mm/dd)
  • end_date
    The end date of when you want to view API usage. (format: yyyy/mm/dd)
  • https://api.zerobounce.net/v2/getapiusage?api_key=your-api-key&start_date=2018-01-01&end_date=2019-12-12

The API will return these results in a JSON format using the "getapiusage" method.

The API will return these results in a JSON format using the "getapiusage" method.

  • Parameter
    Description
  • total
    Total number of times the API has been called
  • status_valid
    Total valid email addresses returned by the API
  • status_invalid
    Total invalid email addresses returned by the API
  • status_catch_all
    Total catch-all email addresses returned by the API
  • status_do_not_mail
    Total do not mail email addresses returned by the API
  • status_spamtrap
    Total spamtrap email addresses returned by the API
  • status_unknown
    Total unknown email addresses returned by the API
  • sub_status_toxic
    Total number of times the API has a sub status of "toxic"
  • sub_status_disposable
    Total number of times the API has a sub status of "disposable"
  • sub_status_role_based
    Total number of times the API has a sub status of "role_based"
  • sub_status_possible_trap
    Total number of times the API has a sub status of "possible_trap"
  • sub_status_global_suppression
    Total number of times the API has a sub status of "global_suppression"
  • sub_status_timeout_exceeded
    Total number of times the API has a sub status of "timeout_exceeded"
  • sub_status_mail_server_temporary_error
    Total number of times the API has a sub status of "mail_server_temporary_error"
  • sub_status_mail_server_did_not_respond
    Total number of times the API has a sub status of "mail_server_did_not_respond"
  • sub_status_greylisted
    Total number of times the API has a sub status of "greylisted"
  • sub_status_antispam_system
    Total number of times the API has a sub status of "antispam_system"
  • sub_status_does_not_accept_mail
    Total number of times the API has a sub status of "does_not_accept_mail"
  • sub_status_exception_occurred
    Total number of times the API has a sub status of "exception_occurred"
  • sub_status_failed_syntax_check
    Total number of times the API has a sub status of "failed_syntax_check"
  • sub_status_mailbox_not_found
    Total number of times the API has a sub status of "mailbox_not_found"
  • sub_status_unroutable_ip_address
    Total number of times the API has a sub status of "unroutable_ip_address"
  • sub_status_possible_typo
    Total number of times the API has a sub status of "possible_typo"
  • sub_status_no_dns_entries
    Total number of times the API has a sub status of "no_dns_entries"
  • sub_status_role_based_catch_all
    Total role based catch alls the API has a sub status of "role_based_catch_all"
  • sub_status_mailbox_quota_exceeded
    Total number of times the API has a sub status of "mailbox_quota_exceeded"
  • sub_status_forcible_disconnect
    Total forcible disconnects the API has a sub status of "forcible_disconnect"
  • sub_status_failed_smtp_connection
    Total failed SMTP connections the API has a sub status of "failed_smtp_connection"
  • start_date
    Start date of query. (format: yyyy/mm/dd)
  • end_date
    End date of query. (format: yyyy/mm/dd)

Get API Usage Code Samples

  • Visual Basic
  • C#
  • PHP
  • Java
  • Python
  • Swift
  • Objective C
  • Android Java
' Complete API Libraries and Wrappers can be found here: ' https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__dot_netTryDimapi_key asstring="Your Secret Key"Dimstart_date asstring="2018-01-01"Dimend_date asstring="2019-12-12"DimresponseString asstring=""DimapiURL asstring="https://api.zerobounce.net/v2/getapiusage?api_key="&api_key &"&start_date="&start_date &"&end_date="&end_date Dimrequest AsHttpWebRequest =DirectCast(WebRequest.Create(apiURL),HttpWebRequest)request.Timeout=150000request.Method ="GET"Usingresponse AsWebResponse =request.GetResponse()response.GetResponseStream().ReadTimeout =20000Usingostream AsNewStreamReader(response.GetResponseStream())responseString =ostream.ReadToEnd()EndUsingEndUsingCatchex asexception
'Catch Exception - All errors will be shown here - if there are issues with the APIEndTry
// Complete API Libraries and Wrappers can be found here: // https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__dot_net// https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__c-sharptry{stringapi_key ="Your Secret Key";stringstart_date ="2018-01-01";stringend_date ="2019-12-12";stringresponseString ="";stringapiURL ="https://api.zerobounce.net/v2/getapiusage?api_key="+api_key +"&start_date="+start_date +"&end_date="+end_date;HttpWebRequestrequest =(HttpWebRequest)WebRequest.Create(apiURL);request.Timeout =150000;request.Method ="GET";using(WebResponseresponse =request.GetResponse()){response.GetResponseStream().ReadTimeout =20000;using(StreamReaderostream =newStreamReader(response.GetResponseStream())){responseString =ostream.ReadToEnd();}}}catch(exception ex){//Catch Exception - All errors will be shown here - if there are issues with the API}
<?php// Complete API Libraries and Wrappers can be found here: // https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__php//set the api key and email to be validated$api_key='Your Secret Key';$start_date='2018-01-01';$end_date='2019-12-12';// use curl to make the request$url='https://api.zerobounce.net/v2/getapiusage?api_key='.$api_key.'&start_date='.$start_date.'&end_date='.$end_date;$ch=curl_init($url);//PHP 5.5.19 and higher has support for TLS 1.2curl_setopt($ch,CURLOPT_SSLVERSION,6);curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,15);curl_setopt($ch,CURLOPT_TIMEOUT,150);$response=curl_exec($ch);curl_close($ch);//decode the json response$json=json_decode($response,true);?>
//Complete API Libraries and Wrappers can be found here: //https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__javaimportjava.io.BufferedReader;importjava.io.InputStreamReader;importjava.net.HttpURLConnection;importjava.net.URL;publicclassMyClass{publicstaticvoidmain(String[]args){Stringkey ="Your Secret Key";Stringstart_date ="2018-01-01";Stringend_date ="2019-12-12";StringtargetURL ="https://api.zerobounce.net/v2/getapiusage?api_key="+key+"&start_date="+start_date+"&end_date="+end_date;HttpURLConnectionconnection =null;finalStringUSER_AGENT ="Mozilla/5.0";try{URLurl =newURL(targetURL);connection =(HttpURLConnection)url.openConnection();connection.setRequestMethod("GET");connection.addRequestProperty("User-Agent",USER_AGENT);connection.setUseCaches(false);connection.setDoOutput(true);BufferedReaderin =newBufferedReader(newInputStreamReader(connection.getInputStream()));StringinputLine;StringBufferresponse =newStringBuffer();while((inputLine =in.readLine())!=null){response.append(inputLine);}in.close();//print resultSystem.out.println(response.toString());}catch(Exceptione){e.printStackTrace();}finally{if(connection !=null){connection.disconnect();}}}}
# Complete API Libraries and Wrappers can be found here: # https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__pythonurl ="https://api.zerobounce.net/v2/getapiusage"api_key ="Your Secret Key"start_date ="2018-01-01"end_date ="2019-12-12"params ={"api_key":api_key,"start_date":start_date,"end_date":end_date}response =requests.get(url,params=params)# Print the returned jsonprintjson.loads(response.content)
// Complete API Libraries and Wrappers can be found here: // https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__IOSletkey ="Your Secret Key"letstart_date ="2018-01-01"letend_date ="2019-12-12"//ip address can be blankleturl =URL(string:String(format:"https://api.zerobounce.net/v2/getapiusage?api_key=%@&start_date=%@&end_date=%@",key,start_date,end_date))lettask =URLSession.shared.dataTask(with:url!){(data,response,error)iniferror !=nil{NSLog("Error (String(describing: error))")}else{do{letparsedData =tryJSONSerialization.jsonObject(with:data!)as![String:Any]for(key,value)inparsedData {NSLog("(key)=(value) ")}}catch{print("Error deserializing JSON: (error)")}}}task.resume()
// Complete API Libraries and Wrappers can be found here: // https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__IOSNSString *key =@"Your Secret Key";NSString *start_date =@"2018-01-01";NSString *end_date =@"2019-12-12";NSString *urlString =[NSString stringWithFormat:@"https://api.zerobounce.net/v2/getapiusage?api_key=%@&start_date=%@&end_date=%@",key,start_date,end_date];__block NSURL *url =[NSURL URLWithString:urlString];dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0),^{NSData *response =[NSData dataWithContentsOfURL:url];NSDictionary *arrResponse =nil;if(response!=nil){arrResponse =[NSJSONSerialization JSONObjectWithData:response options:kNilOptions error:nil];}dispatch_async(dispatch_get_main_queue(),^(void){for(NSString *key in[arrResponse allKeys]){NSLog(@"%@: %@",key,[arrResponse objectForKey:key]);}// callback(nil, arr);});});
// Complete API Libraries and Wrappers can be found here: // https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__android//Add to build.gradle (App) in the "android" bracket:useLibrary 'org.apache.http.legacy'Example:android {compileSdkVersion 25useLibrary 'org.apache.http.legacy'}//-----------------------------------//Filename: JsonParser.javaimportandroid.os.AsyncTask;importorg.json.JSONObject;importjava.util.Iterator;publicclassMainActivityextendsAppCompatActivity{@OverrideprotectedvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);newAsyncTaskParseJson().execute();}}publicclassAsyncTaskParseJsonextendsAsyncTask<String,String,String>{Stringkey ="Your Secret Key";Stringstart_date ="2018-01-01";Stringend_date ="2019-12-12";Stringurl ="https://api.zerobounce.net/v2/getapiusage?api_key="+key+"&start_date="+start_date+"&end_date="+end_date;@OverrideprotectedvoidonPreExecute(){}@OverrideprotectedStringdoInBackground(String...arg0){JsonParserjParser =newJsonParser();JSONObjectjson =jParser.getJSONFromUrl(url);Iteratorkeys =json.keys();while(keys.hasNext()){Stringkey =(String)keys.next();try{System.out.println("ZeroBounce: "+key+"="+json.get(key).toString());}catch(Exceptione){}}returnnull;}@OverrideprotectedvoidonPostExecute(StringstrFromDoInBg){}}//----------------------------------//Filename: MainActivity.javapackagecom.zerobounce.zbapiandroid;importjava.io.BufferedReader;importjava.io.IOException;importjava.io.InputStream;importjava.io.InputStreamReader;importjava.io.UnsupportedEncodingException;importorg.apache.http.HttpEntity;importorg.apache.http.HttpResponse;importorg.apache.http.client.ClientProtocolException;importorg.apache.http.client.methods.HttpGet;importorg.apache.http.impl.client.DefaultHttpClient;importorg.json.JSONException;importorg.json.JSONObject;importandroid.util.Log;publicclassJsonParser{finalStringTAG ="JsonParser.java";staticInputStreamis =null;staticJSONObjectjObj =null;staticStringjson ="";publicJSONObjectgetJSONFromUrl(Stringurl){try{DefaultHttpClienthttpClient =newDefaultHttpClient();HttpGethttpGet =newHttpGet(url);HttpResponsehttpResponse =httpClient.execute(httpGet);HttpEntityhttpEntity =httpResponse.getEntity();is =httpEntity.getContent();}catch(UnsupportedEncodingExceptione){e.printStackTrace();}catch(ClientProtocolExceptione){e.printStackTrace();}catch(IOExceptione){e.printStackTrace();}try{BufferedReaderreader =newBufferedReader(newInputStreamReader(is,"iso-8859-1"),8);StringBuildersb =newStringBuilder();Stringline =null;while((line =reader.readLine())!=null){sb.append(line +"
");}is.close();json =sb.toString();}catch(Exceptione){Log.e(TAG,"Error converting result "+e.toString());}try{jObj =newJSONObject(json);}catch(JSONExceptione){Log.e(TAG,"Error parsing data "+e.toString());}returnjObj;}}

Endpoint Response

Successful Response

{"total":3,"status_valid":1,"status_invalid":2,"status_catch_all":0,"status_do_not_mail":0,"status_spamtrap":0,"status_unknown":0,"sub_status_toxic":0,"sub_status_disposable":0,"sub_status_role_based":0,"sub_status_possible_trap":0,"sub_status_global_suppression":0,"sub_status_timeout_exceeded":0,"sub_status_mail_server_temporary_error":0,"sub_status_mail_server_did_not_respond":0,"sub_status_greylisted":0,"sub_status_antispam_system":0,"sub_status_does_not_accept_mail":0,"sub_status_exception_occurred":0,"sub_status_failed_syntax_check":0,"sub_status_mailbox_not_found":2,"sub_status_unroutable_ip_address":0,"sub_status_possible_typo":0,"sub_status_no_dns_entries":0,"sub_status_role_based_catch_all":0,"sub_status_mailbox_quota_exceeded":0,"sub_status_forcible_disconnect":0,"sub_status_failed_smtp_connection":0,"start_date":"1/1/2018","end_date":"12/12/2019"}

Error Response - API Key

{"error":"Invalid API Key"}

Error Response - Date

{"error":"Invalid Date"}