Good morning,
I have the following problem:
- I need a code that, according to the result of a drop-down list, indicates which number belongs to that selection and then searches the given site for the information it receives.
I'll illustrate the attached photo.
Ihavethecodesinjsonofveiculos.fipe.org.br,theseare:
'TheAPImakesyoursearchdataavailableinJSONformat.CheckoutthebaseAPIaccessURL:
Theparameter[type]acceptsthreepossiblevalues:cars,motorcyclesorpaths.
Theparameter[action]isrelatedtothetypeofdatayouwanttoget.
Firstlylistthebrandsofthetypeofvehicleyouwant,throughtheactiontagsandwithoutanyparameters:
GET: link
The response will be an array of data in the JSON format:
[
{"key": "audi-6", "id": 6, "fipe_name": "Audi", "name": "AUDI"},
{"key": "bmw-7", "id": 7, "fipe_name": "BMW", "name": "BMW"},
{"key": "gm-chevrolet-23", "id": 23, "fipe_name": "GM - Chevrolet", "name": "CHEVROLET"},
{"key": "fiat-21", "id": 21, "fipe_name": "Fiat", "name": "FIAT"},
...
]
In sequence you can obtain the listing of vehicles of a particular brand, through the action vehicles together with the code (id) of the desired mark. For example the Fiat brand (21):
GET: link
And the answer:
[
...
{"key": "palio-4826", "name": "Palio 1.0 Celebr. ECONOMY F.Flex 8V 4p", "id": "4826", "fipe_name": "Palio 1.0 Celebr. ECONOMY F.Flex 8V 4p"},
{"key": "palio-4827", "name": "Palio 1.0 ECONOMY Fire Flex 8V 2p", "id": "4827", "fipe_name": "Palio 1.0 ECONOMY Fire Flex 8V 2p"},
{"key": "palio-4828", "name": "Palio 1.0 ECONOMY Fire Flex 8V 4p", "id": "4828", "fipe_name": "Palio 1.0 ECONOMY Fire Flex 8V 4p"},
{"key": "palio-505", "name": "Palio 1.0/ Trofeo 1.0 Fire/ Fire Flex 2p", "id": "505", "fipe_name": "Palio 1.0/ Trofeo 1.0 Fire/ Fire Flex 2p"},
...
]
After choosing the vehicle you want, you can check the models and the years available for a future price inquiry. Through the vehicle action (in the singular) together with the brand code and the vehicle id (id). For example Palio 1.0 ECONOMY Fire Flex 8V 4p:
GET: link
And the answer:
[
{"fipe_codigo": "32000-1", "name": "Zero KM Gasolina", "key": "32000-1", "veiculo": "Palio 1.0 ECONOMY Fire Flex 8V 4p", "id": "32000-1"},
{"fipe_codigo": "2014-1", "name": "2014 Gasolina", "key": "2014-1", "veiculo": "Palio 1.0 ECONOMY Fire Flex 8V 4p", "id": "2014-1"},
{"fipe_codigo": "2013-1", "name": "2013 Gasolina", "key": "2013-1", "veiculo": "Palio 1.0 ECONOMY Fire Flex 8V 4p", "id": "2013-1"},
{"fipe_codigo": "2012-1", "name": "2012 Gasolina", "key": "2012-1", "veiculo": "Palio 1.0 ECONOMY Fire Flex 8V 4p", "id": "2012-1"},
...
]
Finally adding another parameter to the vehicle action you can view the current price of the FIPE Chart for this vehicle / model / year. Continuing with the example above to obtain the value of a vehicle from the year 2013 to Gasoline we will use the 2013-1 id:
GET: link
And the answer will be the JSON object related to the data of this vehicle:
{
"id": "2013",
"ano_modelo": "2013",
"marca": "Fiat",
"name": "Palio 1.0 ECONOMY Fire Flex 8V 4p",
"veiculo": "Palio 1.0 ECONOMY Fire Flex 8V 4p",
"preco": "R$ 23.055,00",
"combustivel": "Gasolina",
"referencia": "agosto de 2015",
"fipe_codigo": "001267-0",
"key": "palio-2013"
}
'
For what I could do, was to import the list of assemblers into the vba and convert it into a table and make it suspended,
But I do not think I did it correctly and my knowledge of VBA is pretty low, I'm studying to try to develop it, but it's very complicated o.o
I am very grateful for your help, I am always willing to learn, thank you very much ^^
PS: I do not care if it is modified, or any changes made by you