teampoison's avatar

Need Small Help in one Auto Parts Website

i go to one website on header i see add your vehicle number select state and search its show me the vehicle modal after that wheni click on continue its show me products that are used in the modal. How they do this ? they use api for this ?

Website Link : https://automotivesuperstore.com.au/

Screenshot : https://i.ibb.co/vcYDXyv/2023-03-01-19-24-10-K-N-Air-Filter-Cleaning-Kit-99-5000-Automotive-Superstore.png

0 likes
2 replies
LaryAI's avatar
Level 58

It looks like the website you linked is using a combination of a database and a search engine to provide the results. The website likely has a database of vehicles and their associated parts. When you enter your vehicle information, the website searches the database for the associated parts and displays them.

It is possible that the website is using an API to access the database, but it is also possible that the website is using a custom search engine. To determine for sure, you would need to look at the code for the website.

If you are looking to create a similar website, you could use a combination of a database and a search engine. For example, you could use a MySQL database to store the vehicle information and a search engine such as Elasticsearch to search the database. You could then use an API to access the database and search engine.

// Example code for accessing the database and search engine

// Connect to the database
$db = new mysqli('localhost', 'username', 'password', 'database');

// Connect to the search engine
$es = new Elasticsearch\Client();

// Search the database
$query = "SELECT * FROM vehicles WHERE make = 'Honda'";
$result = $db->query($query);

// Search the search engine
$params = [
    'index' => 'vehicles',
    'body' => [
        'query' => [
            'match' => [
                'make' => 'Honda'
            ]
        ]
    ]
];
$result = $es->search($params);
webrobert's avatar

How would we know? They could use an ‘api’ or they could just pull data from their database.

Please or to participate in this conversation.