In my case, I had to include a custom user-agent header along with either acceptJson()
or accept('application/json')
.
\Illuminate\Support\Facades\Http::acceptJson()->withHeaders([
'User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36'
])->get($url);