Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

help with creating a form using API

Featured Replies

hi guys

title may well be misleading and also apologies if this is actually a front-end query but i assumed it probably wasnt.

 

anyway, my company provides many vehicle services such as window tints and vinyl wraps etc...and i basically want something almost exactly like the following:

https://www.window-tint.co.uk/window-tint-simulator

i figured i needed something like http://www.carqueryapi.com - but am not sure if i just need access to the free API or if i need to purchase a database.

its been a few year since ive done any real web dev of note so just looking for some help with this.

 

cheers.

What do you envisage using the API for? The simulator could be done quite easily by having SVG images for the windows, or even the car, and using Javascript to change the opacity. The pricing would be best modelled around your own pricing, having a database of cars and the cost of the various modifications, unless you have a general formula for working out the cost that can be used with the API above. That's if you need to include every car, the only person I know that has tinted windows is @BrowserBugs on his Fiat 500, and I can't imagine that being common.

49 minutes ago, Jack said:

... is @BrowserBugs on his Fiat 500

OMG I'm no Fiat 500 Driver! It's a 1995 Mondeo SI 4x4!

Back on the subject :)

I'm not sure the car query api will cut it, tried to find my car and it doesn't distinguish between hatchback, saloon or estate; big difference on glass size, the rear window on a hatchback mondeo is like a dining table! I don't think you'll need to get too detailed on year, most cars run for a period like MK1 etc.

Either way you'll need a 'base' dataset of common makes, models, years and trim to get some kind of pricing running (probably bought). Then use an api with a "can't find your model, search by registration" and then use a reg api and store the new make / model details so it's there for future selection.

  • Author

first of all thanks for all of the feedback

 

secondly, forgive me if i also sound stupid at times...

 

so im either going to need a car database that includes, say, window measurments as well as year, make, model...or add a [price] field to an exisiting db? because i only need to be as specific as the model in order to get the price. and the prices are only going to vary a little.

 

how do you think the window-tint.co.uk website has been programmed? i was advised by someone that they probably just use an API hence why i thought this was possible.

1 hour ago, sergiogiorgini said:

how do you think the window-tint.co.uk website has been programmed?

By spending a lot of money.  There is a lot of code hidden away that creates the form and displays all the outputs.

It's not actually that good. I expected the the image of the car to change when I selected the model. Because it doesn't you don't get a good representation of how the windows will look.

It also allows me to add limo tint to the drivers window which is not permitted: https://www.gov.uk/tinted-vehicle-window-rules

23 hours ago, sergiogiorgini said:

so im either going to need a car database that includes, say, window measurments as well as year, make, model...or add a [price] field to an exisiting db? because i only need to be as specific as the model in order to get the price. and the prices are only going to vary a little.

how do you think the window-tint.co.uk website has been programmed? i was advised by someone that they probably just use an API hence why i thought this was possible.

The window tint example, api or local db, either way you need something to "select make" (table of makes), "select model" (same table but where model = id of make?), trim (e.g. Hatchback, Estate etc of their make and model), year simply closes the range of possible makes and models for the year, e.g. Citroen made the 2CV 1948–1990 so if the year was 1995 then a Citreon 2CV isn't a possible combination.

Second you will need to assign a price for that particular vehicle. Even though you say prices vary a little, if they vary it's a factor else you'll lose money on certain combinations. If the loss difference is liveable then forget even approaching this and go for a fixed price, if it's not then you'll need this function. If approaching it think, is it the vehicle or amount of tint that fluxes the price? If it's "dimensions" it might be easier to input the window dimensions per window (front side/rear side/rear) and then have a "price per X" measure for the tints. This way, although labour intensive, if the cost of say 50% tint changes from £1 per square meter to £1.10 per square meter then a small change to the price per meter would update site wide in a heartbeat.

Third, at this point a site owner sh*ts themself; "You mean I actually have to put numbers in? I thought your code would do that for me". Yes, this approach is long winded, lots of makes, models and dimensions. If there is no database with make, model, year, trim, window size then one needs to be made. Window measurements can be found on the manufacturers readout, it's just data entry. That said, now you have a database of makes, models, years, trim and window size. How many other window tinting companies would pay you well for a copy, or an api?

Jack Johnson taught me to reduce, reuse, recycle .... stands true with development ;)

Edit: To ease the pain it might be possible to just categorise cars as small, medium, large, xl, coupe or something; then do set price for each. Whatever path you choose data entry is unavoidable.

Edited by BrowserBugs
Thought of Something

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.