Core APIs
Zipcodes API
Delete
3min
delete zipcode delete delete /zipcodes to delete zipcodes from your account you should make an http delete request to the delete zipcodes endpoint, specifying an array of objects containing a zipcode and domain property describing the zipcodes you'd like to delete zipcodes can also be deleted visually via the dashboard https //app rainforestapi com/zipcodes zipcode deletion & collections note that when a zipcode is deleted any requests using that zipcode in their customer zipcode parameter will fail this includes any requests that use this zipcode and are part of collections you may already have set up on your account for more information about using zip & postal codes with rainforest api please see the zipcodes overview https //docs trajectdata com/rainforestapi/zipcodes api/overview $ curl x delete "https //api rainforestapi com/zipcodes?api key=demo" \\ \ data '\[ { "zipcode" "10550", "domain" "amazon com" } ]'const axios = require('axios'); const body = \[ { 'zipcode' '10550', 'domain' 'amazon com' } ]; axios delete('https //api rainforestapi com/zipcodes?api key=demo', body) then(response => { const apiresponse = response data; console log('zipcodes deleted ' + json stringify(apiresponse, 0, 2)); }) catch(error => { console log(error); });import requests import json body = \[ { 'zipcode' '10550', 'domain' 'amazon com' } ]; api result = requests delete('https //api rainforestapi com/zipcodes?api key=demo', json=body) api response = api result json() print "zipcodes deleted ", json dumps(api response)\<?php $body = array( array( 'zipcode' => '10550', 'domain' => 'amazon com' ) ); $ch = curl init('https //api rainforestapi com/zipcodes?api key=demo'); curl setopt($ch, curlopt returntransfer, true); curl setopt($ch, curlopt followlocation, true); \# the following options are required if you're using an outdated openssl version \# more details https //www openssl org/blog/blog/2021/09/13/letsencryptrootcertexpire/ curl setopt($ch, curlopt ssl verifyhost, false); curl setopt($ch, curlopt ssl verifypeer, false); curl setopt($ch, curlopt timeout, 180); curl setopt($ch, curlopt customrequest, "delete"); curl setopt($ch, curlopt postfields, json encode($body)); $json = curl exec($ch); curl close($ch); $api result = json decode($json, true); print r($api result); echo "zipcodes deleted", php eol; ?> an example of a successful response to the delete zipcodes api is shown below { "request info" { "success" true, "message" "1 zipcode deleted" } } next steps zipcodes overview https //docs trajectdata com/rainforestapi/zipcodes api/overview listing all zipcodes via the zipcodes api https //docs trajectdata com/rainforestapi/zipcodes api/list adding a zipcode via the zipcodes api https //docs trajectdata com/rainforestapi/zipcodes api/add