Replies: 17 comments 1 reply
-
Isso facilitaria muito a vida do ecommerce brasileiro. A disponibilidade da API de fretes está longe de 99.9%, principalmente em datas promocionais nacionais, como black friday. Estou disposto a participar como dev dessa feature. |
Beta Was this translation helpful? Give feedback.
-
Correios disponibiliza uma API para o calculo de entrega, calculo de preço da entrega e etc. Poderíamos utilizar. |
Beta Was this translation helpful? Give feedback.
-
Cara, esta API tem dado problema direto, um amigo meu utilizou ela em uma loja virtual que ele desenvolveu, ele teve que implementar uma alternativa usando Frenet, pois a API dos correios direto estava dando timeout, ou erro 500 ou algum outro erro qualquer. E acho impressionante a decadência do serviço, pois algum tempo atrás fiz essa integração e funcionava muito bem, com um uptime muito bom e de uns tempos para cá começou a ficar instável a um ponto que não estava mais confiável a utilização em produção. |
Beta Was this translation helpful? Give feedback.
-
Não sabia, obrigado pela informação. Tava achando esquisito que poucas pessoas falavam dela, agora ta explicado kkkk. |
Beta Was this translation helpful? Give feedback.
-
Infelizmente ela tem estado bem instável ultimamente, se houvesse alguma api aberta para isso, como existe a do CEP, seria mais fácil, porém ainda é possível tentar fazer via web scrapping, mas ai qualquer alteração no layout da página dos correios poderia quebrar o módulo. |
Beta Was this translation helpful? Give feedback.
-
Pessoal, vou colocar comentários que podem ser úteis na discussão: Eu tenho já instalei alguns ecommerces e utilizo um plugin chamado Correios para Woocommerce criado pelo Cláudio Sanches da Automattic, que mantém o Woocommerce. Sobre minha experiência existe muita intermitência no server dos correios e é comum relatos de clientes que não conseguem calcular fretes. Em contrapartida, existe um plugin chamado Frete offline desenvolvido pelo Fernando Acosta e com cobrança anual e é baseado em planilha com faixas de CEP. Existe dois serviços que entrega cotações de frete dos correios usando seus próprios servidores. Um deles é o Melhor Envio. Outro é o Frenet. Então de fato há formas de desenvolver uma api própria, não sei se com webscraping, precisaria ter consistência para não quebrar em mudanças nos parâmetros dos correios. Abaixo um exemplo de URL que traz um frente passando a cubagem e peso, cep de origem e destino. Há dois parâmetros que podem ser passados para mostrar valores diferentes com base em clientes (donos de loja) que possuam contrato com os Correios. São eles:
|
Beta Was this translation helpful? Give feedback.
-
@brunomarks7 Lembrando também, que o valor do frete também pode sofrer alterações de acordo o o valor declarado do produto. |
Beta Was this translation helpful? Give feedback.
-
@RodriAndreotti perfeito! O ruim desse processo de tentar consultar nos Correios e usar um servidor próprio como segunda opção de fallback é que geralmente o tempo de resposta dos Correios (apesar do server no Brasil) sempre será mais lerdo, ainda mais se estiver congestionado em datas comerciais. Se não me engano a Frenet tem uma tolerância, um timeout para os serviços dos Correios pra passar a requisitar a API própria. Qualquer ganho de tempo é muito importante para o ecommerce, mesmo 100ms. Eu fiquei fascinado com a latência desses servidores da Vercel! O que pra mim é um mistério é qual melhor forma de obter esses dados, se é via Web Scraping mesmo ou com algum outro método. |
Beta Was this translation helpful? Give feedback.
-
Então, @brunomarks7 ! E usar um serviço, tipo frenet, que tem uma limitação na quantidade de requisições mensais, não sei se é a melhor forma também. :/ Esta é uma discussão que seria interessante aprofundar antes de mergulhar no desenvolvimento deste módulo (que é um módulo muito útil, diga-se de passagem) |
Beta Was this translation helpful? Give feedback.
-
Perfeito Rodrigo!
Concordo plenamente com você. Ter uma API confiável, com baixa latência e
com um bom cache para cotações de fretes seria um passo importante e que
resultaria em um aumento de vendas em muitos ecommerces.
O Frenet eu nem mencionei no sentido de usar o serviço deles, pois o ideal
é ter menos intermediários possíveis. Mas sim no sentido de investigar o
que essas empresas fazem para ter a base atualizada.
Vamos continuar com as ideias, um abraço!
Em qui., 16 de jul. de 2020 às 13:39, Rodrigo Texeira Andreotti <
notifications@github.com> escreveu:
… Então, @brunomarks7 <https://github.com/brunomarks7> !
Imagino eu que a forma menos instável, considerando a atual situação do
webservice dos correios, seja o web scrapping, porém o serviço fica
completamente suscetível a uma mudança de layout no site deles, e ai,
lascou-se... kkk
E usar um serviço, tipo frenet, que tem uma limitação na quantidade de
requisições mensais, não sei se é a melhor forma também. :/
Esta é uma discussão que seria interessante aprofundar antes de mergulhar
no desenvolvimento deste módulo (que é um módulo muito útil, diga-se de
passagem)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<https://github.com/filipedeschamps/BrasilAPI/issues/75#issuecomment-659531194>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AG3TMMDNIXFOLZM7N4MHFVLR34UL7ANCNFSM4NXRZBHQ>
.
--
*Bruno Marques*
|
Beta Was this translation helpful? Give feedback.
-
Opa pessoal, vivi um pouco dessa dor trabalhando com integração de Marketplace. O caminho seguido geralmente é manter uma planilha estática e consultar dela. De tempo em tempo, geralmente madrugada, atualizar essa planilha numa rotina densa, consultando nos correios todas as faixas de cep (tentando até conseguir consultar). Isso era necessário justamente por causa da latencia indesejada no ambiente dos e-commerces/marketplaces. |
Beta Was this translation helpful? Give feedback.
-
Mas para isso precisaríamos saber também qual é a regra de negócios para o cálculo do valor, pois o valor do frete varia de acordo com peso, tamanho e valor declarado do objeto. |
Beta Was this translation helpful? Give feedback.
-
Você está correto. Esxistem mais dados que são levados em consideração no caclulo. O manual dos correios é disponibilizado em https://correios.com.br/enviar-e-receber/ferramentas/calculador-remoto-de-precos-e-prazos/pdf/manual-de-implementacao-do-calculo-remoto-de-precos-e-prazos/view dentre eles:
|
Beta Was this translation helpful? Give feedback.
-
Andei pesquisando sobre cálculo de cubagem dos Correios e encontrei o seguinte: https://esales.com.br/blog/calculo-de-frete-correios/ Só para documentar pois de repente alguém tem alguma ideia com relação a esse dado. Quero em breve começar a fazer alguns testes de rotinas com múltiplas variáveis de pesos e CEPs diferentes, gravando o retorno da API dos correios. |
Beta Was this translation helpful? Give feedback.
-
Criei um novo PR #260 para continuar o trabalho feito no #76, tem algumas tarefas pendentes, caso alguém tenha interesse em colaborar. |
Beta Was this translation helpful? Give feedback.
-
Só para eu entender, vocês acham que faz sentido colocar essa rota no BrasilAPI? Pelo que entendo todas as demais rotas funcionam com dados cacheados e podem ser reaproveitadas por outros usuários. Pergunto isso porque sinto um cheiro de que essa rota seria muito específica para cada cliente, o que não tiraria um bom proveito dos caches. E quanto é um bom tempo para se ter de cache do preço e prazo do frete? |
Beta Was this translation helpful? Give feedback.
-
algum update? essa rota esta disponivel? |
Beta Was this translation helpful? Give feedback.
-
Seguindo a ideia e problemática apresentada no readme:
Uma das funções que pessoalmente precisei implementar no servidor, uma vez que conforme dito não conseguimos acessar direto do navegador, é a função retorno do valor de frete, dado o cep de origiem, o cep de destino, e mais algumas informações do produto.
Links:
Preços e prazos Correios
Beta Was this translation helpful? Give feedback.
All reactions