Closed paishin closed 4 years ago
Companies are not searchable sadly. See https://api-docs.igdb.com/#search-1 for reference.
Only the following endpoints are searchable:
Okay, I've got another question that's similar. I'm trying to find the manufacturer of a platform:
$plats = Platform::search('Xbox')->with(['versions', 'versions.companies', 'versions.companies.company'])->get();
But none of that shows the main_manufacturer
that is listed in the docs for Platform Version
([docs](endpoint: platform_versions)). Nor does the company
show a name
as the docs show ([endpoint: companies]https://api-docs.igdb.com/?java#company). Am I missing something with this?
Thanks for your help.
EDIT: UGH! Sorry about putting the question here. I meant to reply to my other post, not necro this one.
@PiousVenom This seems to be a problem with the API itself. The data is not returned by the API either if you call it directly.
Try calling the following (via Postman for example) with your Client-ID and access token:
POST https://api.igdb.com/v4/platforms
fields *,versions.*,versions.companies.*,versions.companies.company.*,versions.main_manufacturer.*;
search "Xbox";
It seems you found some data inconsistencies between igdb.com and the API. Because https://www.igdb.com/platforms/xbox shows a manufacturer (even if without a "real" name because the name seems to be just the ID) but the API does not return a company which has manufacturer
set to true
or a main_manufacturer
.
What is more the API only returns data if it is filled. So if there is no name for a company it is not returned at all.
Try reaching out to the guys at IGDB (via their Discord for example). They may sort you out and can check why the data is missing in the API. If I remember correctly they have some sort of sync job between the data on the website and the API. Maybe there is a problem and therefore the data is missing in the API.
Thanks. I've reached out on Discord. Wonder how long it's been an issue...
I have tried searching on companies endpoint using the Company Model with no success. I am using the exact same code I use for searching games but I always get an empty collection.
$companies = Company::search('SEGA')->get();
Is this a bug, or am I doing something wrong?