Autoscout

This TYPO3 extension is an add-on to the extension "fahrzeugsuche". It allows you to import your vehicle data from autoscout24.de

Requirements

  • curl
  • Scheduler/Cronjob

Installation

Install the extension using the extension manager or composer:

composer req codingms/autoscout

Configuration

  1. Create a sysfolder where the imported data should be stored.
  2. Create a "Connection record", set "source" to "autoscout24.de".
  3. Fill in an ID, you can choose this freely.
  4. Fill in username and password for your autoscout24.de API. You should get it from https://listing-search.api.autoscout24.com/docs/#/authentication_authorization.
  5. Optionally: Adjust "Query" and "Additional Fields" to your needs (see below).

Importing

Create a scheduler Task of type "execute console command" and execute "autoscout:import".

Optionally you can set a connection ID for which to do the import. If this is empty, all data for all connections of type "autoscout" will be imported.

You can also use the TYPO3 command line interface:

vendor/bin/typo3 autoscout:import

Accessing additional data

Some data is only available in the XML, not in the database. This data is stored in the "additional" node which can be accessed via fluid with {fahrzeug.additional}

Additional images and equipments will be imported automatically.

In order to import more fields from AutoScout24 and make them available in the fluid templates proceed as follows.

  • In the "connection"-record adjust the "Query" and add the desired fields.
  • In the "connection"-record adjust the "Additional fields". Use the Pfad from the query and use the minus character ("-") as separator (example see below).
  • In the fluid template you can access the additional fields via {fahrzeug.additional.NAME} eg. {fahrzeug.additional.details-location-city}.

Example: Accessing the additional images / equipments

<f:for each="{fahrzeug.additional.images}" as="image">
    <h3>Size S</h3>
    {image.size-s}<br/>
    <f:image src="{image.size-s}"></f:image><br/>

    <h3>Size M</h3>
    {image.size-m}<br/>
    <f:image src="{image.size-m}"></f:image><br/>

    <h3>Size L</h3>
    {image.size-l}<br/>
    <f:image src="{image.size-l}"></f:image><br/>

    <h3>Size XL</h3>
    {image.size-xl}<br/>
    <f:image src="{image.size-xl}"></f:image><br/>

    <h3>Size 2XL</h3>
    {image.size-2xl}<br/>
    <f:image src="{image.size-2xl}"></f:image><br/>

    <h3>Size 3XL</h3>
    {image.size-3xl}<br/>
    <f:image src="{image.size-3xl}"></f:image><br/>

    <h3>Size 4XL</h3>
    {image.size-4xl}<br/>
    <f:image src="{image.size-4xl}"></f:image><br/>
</f:for>
<f:for each="{fahrzeug.additional.equipments}" as="equipment">
    <ul>
        <li>ID formatted: {equipment.id-formatted}</li>
        <li>ID raw: {equipment.id-raw}</li>
        <li>Category formatted: {equipment.category-formatted}</li>
        <li>Category raw: {equipment.category-raw}</li>
    </ul>
</f:for>

Example: Access to addition custom fields

Example: "seller" --> "companyName"

Connection-Record: Query

query MyCustomSearch {
  search {
    listings(metadata: {size: 400}) {
      listings {
        id
        details {
          seller {
            id
            companyName
          }
          [...]

Connection-Record: Additional fields

details-seller-companyName

Fluid-Template

{fahrzeug.additional.details-seller-companyName}

Show vehicles of different locations on different pages

If you want to show vehicles of different locations on different locations, proceed as follows.

  • Create one folder per location (eg. "Vehicles Berlin", "Vehicles Munic").
  • Create a connection in each of these folders. Important: Each connection has to have a unique ID, eg. the location name. You can use the same account credentials for all connections.
  • Adjust the query so that only vehicles from that location will be imported (example see below).
  • Create a page for each location and add the "Fahrzeugsuche" plugin to that page.
  • Create an extension template on each page and add the IDs of the folders as Container-ID in the constants section: themes.configuration.container.fahrzeugsuche = 123. If you want to show the vehicles of multiple locations add them comma-separated: themes.configuration.container.fahrzeugsuche = 123,124

Example: Query for vehicles of a location

Example query for ZIP "12345":

query MyCustomSearch {
  search {
    listings(metadata: {size: 400}, location: { zip: "12345", radius: 1 }) {
      listings {
        id
        details {
          [...]