datosgobar / georef-ar-api

API del Servicio de Normalización de Datos Geográficos de Argentina.
https://apis.datos.gob.ar/georef
MIT License
153 stars 35 forks source link

403 Forbidden API /provincias #218

Open FranPena00 opened 1 year ago

FranPena00 commented 1 year ago

Al pegarle por postman a dicha url: https://apis.datos.gob.ar/georef/api/provincias?nombre=Ciudad%20de%20Buenos%20Aires responde correctamente con un 200. Sin embargo, al armar un script en php me responde con un 403 y con el siguiente html:

<!DOCTYPE html>
<html lang="en-US">

<head>
    <title>Just a moment...</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <meta name="robots" content="noindex,nofollow">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link href="/cdn-cgi/styles/challenges.css" rel="stylesheet">
</head>

<body class="no-js">
    <div class="main-wrapper" role="main">
        <div class="main-content"><noscript>
                <div id="challenge-error-title">
                    <div class="h2"><span class="icon-wrapper">
                            <div class="heading-icon warning-icon"></div>
                        </span><span id="challenge-error-text">Enable JavaScript and cookies to continue</span></div>
                </div>
            </noscript></div>
    </div>
    <script>(function () { window._cf_chl_opt = { cvId: '2', cZone: 'apis.datos.gob.ar', cType: 'managed', cNounce: '86365', cRay: '7f48fc4fb8365a27', cHash: 'e8460056923aed3', cUPMDTk: "\/georef\/api\/provincias?nombre=Ciudad%20de%20Buenos%20Aires&__cf_chl_tk=jZgrGmAezoiJxjYhnKHVH6ATDRjlDXPhi0ceSYTlloQ-1691678338-0-gaNycGzNCvs", cFPWv: 'b', cTTimeMs: '1000', cMTimeMs: '0', cTplV: 5, cTplB: 'cf', cK: "", fa: "/georef/api/provincias?nombre=Ciudad%20de%20Buenos%20Aires&amp;__cf_chl_f_tk=jZgrGmAezoiJxjYhnKHVH6ATDRjlDXPhi0ceSYTlloQ-1691678338-0-gaNycGzNCvs", md: "HSDYH1REooRH_CLp8ZDmaZ7F1HQWxGwfyE._B9uvpTs-1691678338-0-AZHFjOPUFsjQQpB-NCEfzv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PLCkm7DwDMzRP41/mnURFxslkkvJXa4OGvl8XIwM/uBHQIk73b1fYD5WPBvj21yI5XUXhe+ciBGHt8K4iW1h/pChYBdYoHOQWcRIF1i7EFRZaG7pHkm9QW1KhueCZb2fsUJfcwh9VZswVwg/Q/8Rh515POhC2kUk=', t: 'MTY5MTY3ODMzOC41MTcwMDA=', cT: Math.floor(Date.now() / 1000), m: 'gK/eAOjHigAdQZyCRXgpmN/GDC3YLMDi6xmeimkbaaA=', i1: 'awGB5H9yXGjxv4IQXHHCwA==', i2: 'ILRkFU0xpujIiS1BGm7iwA==', zh: '6JOkAfQgysZ61Mpt/AWh5LkA6YnyLaZQ+9LzY7p2r5s=', uh: 'rT0BJUTCV/hOy6HmW5LaKS9MkGB/ufr6PpShvlehbLQ=', hh: 'eB2k2i3ndSLOoFLTtUmUeCoCLzzEx5czH+JiMB5HFC4=', } }; var cpo = document.createElement('script'); cpo.src = '/cdn-cgi/challenge-platform/h/b/orchestrate/chl_page/v1?ray=7f48fc4fb8365a27'; window._cf_chl_opt.cOgUHash = location.hash === '' && location.href.indexOf('#') !== -1 ? '#' : location.hash; window._cf_chl_opt.cOgUQuery = location.search === '' && location.href.slice(0, location.href.length - window._cf_chl_opt.cOgUHash.length).indexOf('?') !== -1 ? '?' : location.search; if (window.history && window.history.replaceState) { var ogU = location.pathname + window._cf_chl_opt.cOgUQuery + window._cf_chl_opt.cOgUHash; history.replaceState(null, null, "\/georef\/api\/provincias?nombre=Ciudad%20de%20Buenos%20Aires&__cf_chl_rt_tk=jZgrGmAezoiJxjYhnKHVH6ATDRjlDXPhi0ceSYTlloQ-1691678338-0-gaNycGzNCvs" + window._cf_chl_opt.cOgUHash); cpo.onload = function () { history.replaceState(null, null, ogU); }; } document.getElementsByTagName('head')[0].appendChild(cpo); }());</script>
</body>
</html>

Script php:

<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://apis.datos.gob.ar/georef/api/provincias?nombre=Ciudad%20de%20Buenos%20Aires",
  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;
}
FranPena00 commented 1 year ago

Puede ser por un limite de pegadas que este respondiendo eso? Ya que le pegamos varias veces por dia a esa url. Gracias!

MarcosDanielTorres commented 1 year ago

@FranPena00 Buenas, tu backend de PHP está corriendo en AWS de casualidad? Porque tenemos un tema similar y creemos que el bloque de AWS está bloqueado

FranPena00 commented 1 year ago

Buenas, exactamente corre sobre AWS.

nacholupotti commented 1 year ago

Buenas tengo el mismo issue. My backend esta levantado en AWS usando el elastic container service.

La respuesta es un 403.

Alguna idea?