clientService->newClient(); $fyydReponse = $fyydClient->get("https://api.fyyd.de/0.2/search/podcast", [ 'query' => [ 'title' => $value, 'term' => $value ] ]); $fyydJson = (array) json_decode((string) $fyydReponse->getBody(), true, flags: JSON_THROW_ON_ERROR); if (array_key_exists('data', $fyydJson) && is_array($fyydJson['data'])) { /** @var string[] $fyydFeed */ foreach ($fyydJson['data'] as $fyydFeed) { $podcasts[] = [ 'id' => $fyydFeed['id'], 'title' => $fyydFeed['title'], 'description' => $fyydFeed['description'], 'image' => $fyydFeed['imgURL'], 'url' => $fyydFeed['xmlURL'], 'lang' => $fyydFeed['language'], 'lastpub' => $fyydFeed['lastpub'] ]; } } } catch (Exception $e) { } return new JSONResponse($podcasts); } }