# REST API: Artikelbild und Preis ausgeben

**URL:** https://forum.shopware.com/t/rest-api-artikelbild-und-preis-ausgeben/94814
**Category:** Programmierung
**Created:** [13. Juni 2022 um 13:27 UTC](https://forum.shopware.com/t/rest-api-artikelbild-und-preis-ausgeben/94814 "2022-06-13T13:27:29Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![winnewoerp](https://avatars.discourse-cdn.com/v4/letter/w/45deac/32.png) [@winnewoerp](https://forum.shopware.com/u/winnewoerp)
#### Post date: [13. Juni 2022 um 13:27 UTC](https://forum.shopware.com/t/rest-api-artikelbild-und-preis-ausgeben/94814/1 "2022-06-13T13:27:29Z")

</div>

Hallo Shopware-Kenner,

ich bin neu bei Shopware und noch nutzen wir Version 5.6.X. Ich versuche, per REST API auf das Atikelbild zuzugreifen. Wie mache ich das? Ich nutze cURL/PHP und so sieht es aus:

```auto
$curl = curl_init();

	curl_setopt_array($curl, array(
	  CURLOPT_URL => 'https://[domain.tld]/api/articles?filter[0][property]=active&filter[0][value]=1&limit=3&sort[0][property]=added&sort[0][direction]=DESC',
	  CURLOPT_RETURNTRANSFER => true,
	  CURLOPT_ENCODING => '',
	  CURLOPT_MAXREDIRS => 10,
	  CURLOPT_TIMEOUT => 0,
	  CURLOPT_FOLLOWLOCATION => true,
	  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
	  CURLOPT_CUSTOMREQUEST => 'GET',
	  CURLOPT_HTTPHEADER => array(
		'Authorization: Basic [key...]'
	  ),
	));

	$response = curl_exec($curl);

```

Ich hole mir also die neuesten drei aktiven Artikel. Aber wie komme ich an das Artikelbild und den Preis? Beides finde ich nicht in den zurückgegebenen Werten.

Danke für eure Tipps!

Viele Grüße  
winnewoerp

---

<div class="post-metadata">

### Author: ![herieth](https://avatars.discourse-cdn.com/v4/letter/h/898d66/32.png) [@herieth](https://forum.shopware.com/u/herieth)
#### Post date: [13. Juni 2022 um 13:42 UTC](https://forum.shopware.com/t/rest-api-artikelbild-und-preis-ausgeben/94814/2 "2022-06-13T13:42:18Z")

</div>

Hallo winnewoerp,

hilft da vielleicht die Doku?

> **[REST API - Examples using the product resource](https://developers.shopware.com/developers-guide/rest-api/examples/article/)**
>
> REST API - Examples using the product resource

Gruß  
Helmut

---

<div class="post-metadata">

### Author: ![R4M](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/r4m/32/9983_2.png) [@R4M](https://forum.shopware.com/u/R4M)
#### Post date: [13. Juni 2022 um 13:54 UTC](https://forum.shopware.com/t/rest-api-artikelbild-und-preis-ausgeben/94814/3 "2022-06-13T13:54:50Z")

</div>

Du bekommst nicht alle Informationen mit deiner erwähnten Abfrage.

1. Für alle Preis-Informationen musst du den Artikel einzeln direkt über die ID abfragen. Dann hast du alle Preise.
2. Für die Produktbilder inkl. URL musst du über „media“ + ID abfragen. Dann hast du auch die URL + Bildname. Die jeweilige Media-ID steht in der Detail-Abfrage Artikel (Array images) mit drin.

---

<div class="post-metadata">

### Author: ![winnewoerp](https://avatars.discourse-cdn.com/v4/letter/w/45deac/32.png) [@winnewoerp](https://forum.shopware.com/u/winnewoerp)
#### Post date: [13. Juni 2022 um 14:41 UTC](https://forum.shopware.com/t/rest-api-artikelbild-und-preis-ausgeben/94814/4 "2022-06-13T14:41:51Z")

</div>

@ [herieth](https://forum.shopware.com/u/herieth) und @ [R4M](https://forum.shopware.com/u/R4M): Besten Dank für die prompten Rückmeldungen! Als Neueinsteiger war ich schlichtweg nicht auf die Idee gekommen, dass man bestimmte Details nicht bei der Listen-Abfrage der Artikel geliefert bekommt und dafür dann „mehrstufige“ Abfragen machen muss.

Herzlichen Gruß  
winnewoerp
