Linkedin Company Data

FREEMIUM
By William Barber | Updated hace un día | Social
Popularity

9.8 / 10

Latency

3,142ms

Service Level

94%

Health Check

100%

Back to All Discussions

Bad Request: There was an error parsing the input (400)

Rapid account: Luke Wilson Storm
LukeWilsonStorm
hace 3 meses

I’m using the code as given to look up company data, but I’m getting an error if I use it anywhere except on this page to test the endpoint.

What am I doing wrong?

This is the result I get:

{"message":"Bad Request: There was an error parsing the input","status_code":400}

const url = 'https://linkedin-company-data.p.rapidapi.com/linkedInCompanyDataJson';
const options = {
	method: 'POST',
	headers: {
		'content-type': 'application/json',
		'X-RapidAPI-Key': 'API_KEY',
		'X-RapidAPI-Host': 'linkedin-company-data.p.rapidapi.com'
	},
	body: {
		liUrls: [
	'https://www.linkedin.com/company/hilton/'
		]
	}
};

try {
	const response = await fetch(url, options);
	const result = await response.text();
	console.log(result);
} catch (error) {
	console.error(error);
}
Rapid account: Luke Wilson Storm
LukeWilsonStorm Commented hace 3 meses

Could be useful to have something on the “Tutorials” page maybe, as there’s nothing there currently.

Rapid account: Williambarberjr
williambarberjr Commented hace 3 meses

Yeah, thanks for the heads up, that’s good to know. I don’t think I have the ability to change that code as it’s auto generated by the platform unfortunately but I’ll look into it.

Rapid account: Luke Wilson Storm
LukeWilsonStorm Commented hace 3 meses

Thanks that worked!

But FYI, that isn’t included or mentioned in the code you can copy from here

Rapid account: Williambarberjr
williambarberjr Commented hace 3 meses

You forgot JSON.stringify() around the body:

JSON.stringify({
liUrls: [
https://www.linkedin.com/company/hilton/
]
})

Join in the discussion - add comment below:

Login / Signup to post new comments