Postal code range from Brazil

I have a chatwoot webhook node that returns custom attributes:

“rua”: “vilebaldo aguiar”, (rua = street)
“cidade”: “fortaleza”, (cidade = city)
“numero”: “3220”, (numero = number)

After that, I make an http request from the viacep api to return postal codes.
The problem is that the api returns several postal codes based on ranges of numbers.

How do I create a javascript code that returns the corresponding postalcode if the number is between the right range?


It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Can you share an example of the output?

What’s this?

@bartv I think that’s the ID of his workflow.

@marcelohhirata Please see the video below on how to embed a workflow into the forum for us to see

Please also share a sample of the response from the postal code API as we will need that to write any code

@marcelohhirata do you still need help with this? If so, we’ll need a little more information to better understand the problem.