curl --request GET \
--url https://api.wppfy.com/proxy-managed/citiesimport requests
url = "https://api.wppfy.com/proxy-managed/cities"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.wppfy.com/proxy-managed/cities', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wppfy.com/proxy-managed/cities",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.wppfy.com/proxy-managed/cities"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.wppfy.com/proxy-managed/cities")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wppfy.com/proxy-managed/cities")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"country": "br",
"state": "sp",
"cities": [
{
"value": "campinas",
"label": "Campinas",
"state": "sp",
"state_label": "São Paulo",
"raw_city": "campinas"
},
{
"value": "saopaulo",
"label": "São Paulo",
"state": "sp",
"state_label": "São Paulo",
"raw_city": "sao_paulo"
}
]
}Proxy Interno - Listar cidades disponíveis
Retorna a lista de cidades disponíveis para uso nos campos
proxy_managed_country, proxy_managed_state e proxy_managed_city dos endpoints
POST /instance/connect.
Respostas de sucesso enviam Cache-Control: public, max-age=300. Se o
catálogo de cidades estiver temporariamente indisponível, tente novamente
depois do intervalo indicado pela resposta.
- Autenticação: endpoint público, sem
token. - Proteção: limite de 120 requisições por minuto por IP; excesso retorna
429comRetry-After. - Query
country(opcional): ISO alpha-2 minúsculo. Defaultbr. - Query
state(opcional): UF/subdivisão minúscula, comosp. - Query
search(opcional): filtro parcial por nome/slug, insensível a acento/caixa.
Como escolher a cidade:
- Use
bremproxy_managed_country. - Chame
GET /proxy-managed/cities?country=brpara obter as cidades brasileiras. - Quando a cidade retornar
state, envie também esse valor emproxy_managed_state. - Quando o usuário escolher uma cidade, envie em
/instance/connect:proxy_managed_country: o país escolhido, ex.brproxy_managed_state: ostateretornado pela cidade, ex.sp, quando disponívelproxy_managed_city: sempre ocities[].value
Se state não vier na cidade selecionada, envie apenas proxy_managed_country e proxy_managed_city.
A API valida a combinação e retorna erro se faltar algum dado necessário.
Exemplo de requisição:
GET /proxy-managed/cities?country=br&state=sp&search=camp
curl --request GET \
--url https://api.wppfy.com/proxy-managed/citiesimport requests
url = "https://api.wppfy.com/proxy-managed/cities"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.wppfy.com/proxy-managed/cities', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wppfy.com/proxy-managed/cities",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.wppfy.com/proxy-managed/cities"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.wppfy.com/proxy-managed/cities")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wppfy.com/proxy-managed/cities")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"country": "br",
"state": "sp",
"cities": [
{
"value": "campinas",
"label": "Campinas",
"state": "sp",
"state_label": "São Paulo",
"raw_city": "campinas"
},
{
"value": "saopaulo",
"label": "São Paulo",
"state": "sp",
"state_label": "São Paulo",
"raw_city": "sao_paulo"
}
]
}Parâmetros de consulta
ISO alpha-2 (minúsculo). Default br.
^[a-z]{2}$Filtra por UF/subdivisão quando o catálogo traz state. Para Brasil, use valores como sp, rj, mg.
^[a-z0-9-]{1,16}$Filtro parcial por nome/slug (insensível a acento/caixa).
