JavaScript
Fetch, filter, and paginate Jobven API job data in JavaScript using the native fetch API.
JavaScript examples using the native fetch API. They run in Node.js (18+) and modern browsers. Set your API key first — see Authentication.
export JOBVEN_API_KEY="your_api_key"
Fetch Jobs
Basic request to list job postings:
const response = await fetch(
'https://api.jobven.com/v1/public/jobs?limit=10',
{
headers: {
'X-API-Key': process.env.JOBVEN_API_KEY
}
}
);
if (!response.ok) {
throw new Error(`API error: ${response.status}`);
}
const { data: jobs } = await response.json();
console.log(`Found ${jobs.length} jobs on this page`);
Filter Jobs
Search for remote React developer positions with a salary floor. Array filters use bracket notation (skills[]):
const params = new URLSearchParams({
q: 'react developer',
limit: '20',
minSalary: '100000'
});
params.append('skills[]', 'react');
params.append('skills[]', 'typescript');
params.append('remoteType[]', 'remote');
const response = await fetch(
`https://api.jobven.com/v1/public/jobs?${params}`,
{
headers: {
'X-API-Key': process.env.JOBVEN_API_KEY
}
}
);
const { data: jobs } = await response.json();
jobs.forEach(job => {
console.log(`${job.title} - ${job.companies[0]?.name}`);
});
For every available filter, see the Filter Jobs guide.
Paginate Results
Fetch all matching jobs using cursor pagination:
async function fetchAllJobs(filters = {}) {
const jobs = [];
let cursor = null;
let hasMore = true;
while (hasMore) {
const params = new URLSearchParams({
...filters,
limit: '100',
...(cursor && { cursor })
});
const response = await fetch(
`https://api.jobven.com/v1/public/jobs?${params}`,
{
headers: {
'X-API-Key': process.env.JOBVEN_API_KEY
}
}
);
const { data, meta } = await response.json();
jobs.push(...data);
cursor = meta.nextCursor;
hasMore = meta.hasMore;
console.log(`Progress: ${jobs.length} jobs fetched`);
}
return jobs;
}
// Usage
const allRemoteJobs = await fetchAllJobs({ 'remoteType[]': 'remote' });
Get a Single Job
Fetch a specific job by ID:
const jobId = 'abc123-def456-ghi789';
const response = await fetch(
`https://api.jobven.com/v1/public/jobs/${jobId}`,
{
headers: {
'X-API-Key': process.env.JOBVEN_API_KEY
}
}
);
if (response.status === 404) {
console.log('Job not found');
} else {
const job = await response.json();
console.log(job.title);
}
Error Handling
Handle authentication and rate limit errors gracefully. There is no Retry-After header — burst-limit 429 responses include a retryAfter value (seconds) in the body:
async function fetchJobs(params) {
const response = await fetch(
`https://api.jobven.com/v1/public/jobs?${new URLSearchParams(params)}`,
{
headers: {
'X-API-Key': process.env.JOBVEN_API_KEY
}
}
);
if (!response.ok) {
const error = await response.json().catch(() => ({}));
switch (response.status) {
case 401:
throw new Error('Invalid API key');
case 429:
// Quota exhausted - retrying won't help until reset
if (error.error === 'Quota Exceeded') {
throw new Error('Monthly quota exhausted');
}
// Burst limit - wait and retry
await new Promise(r => setTimeout(r, (error.retryAfter ?? 1) * 1000));
return fetchJobs(params);
default:
throw new Error(error.message || 'API request failed');
}
}
return response.json();
}
See Handle Rate Limits for the full retry strategy.