UpHunt API

SDKs & Client Libraries

Thin wrappers around the UpHunt REST API in your favorite language.

We currently ship community-maintained SDKs for the most common languages. They're thin wrappers — every feature in the REST API is available.

Don't see your language?

The OpenAPI 3.1 spec at /openapi.json works with openapi-generator and speakeasy to produce idiomatic clients in 40+ languages. Run:

npx @openapitools/openapi-generator-cli generate -i https://uphunt.io/openapi.json -g go -o ./uphunt-client

TypeScript

lib/uphunt.ts
const BASE = 'https://uphunt.io'
const API_KEY = process.env.UPHUNT_API_KEY!
 
type Timeline =
  | 'Less than 1 month'
  | '1 to 3 months'
  | '3 to 6 months'
  | 'More than 6 months'
 
export type ApplyInput = {
  jobId: string
  coverLetter: string
  profileId?: string
  autoFillOtherQuestions?: boolean
  proposal?: {
    hourlyRate?: number
    fixedBid?: number
    timeline?: Timeline
    boostBids?: number
  }
}
 
async function request<T>(path: string, init?: RequestInit): Promise<T> {
  const res = await fetch(`${BASE}${path}`, {
    ...init,
    headers: {
      'Content-Type': 'application/json',
      'x-api-key': API_KEY,
      ...init?.headers,
    },
  })
  if (!res.ok) {
    const body = await res.json().catch(() => ({}))
    throw Object.assign(new Error(body.error ?? res.statusText), { status: res.status, body })
  }
  return res.json() as Promise<T>
}
 
export const uphunt = {
  apply: (input: ApplyInput) =>
    request<{ queueId: string; creditsRemaining: number }>(
      '/api/auto-apply-v2/apply',
      { method: 'POST', body: JSON.stringify(input) },
    ),
 
  status: (queueId: string) =>
    request<{ applicationStatus: string; errorMessage: string | null }>(
      `/api/auto-apply-v2/status?queueId=${encodeURIComponent(queueId)}`,
    ),
 
  generateProposal: (input: { jobId?: string; jobTitle?: string; jobDescription?: string }) =>
    request<{ success: boolean; proposal: string }>(
      '/api/auto-apply-v2/generate-proposal',
      { method: 'POST', body: JSON.stringify(input) },
    ),
}

Usage:

import { uphunt } from './lib/uphunt'
 
const { queueId } = await uphunt.apply({
  jobId: '~01abc123',
  coverLetter: 'Hi, I would love to help...',
  proposal: { hourlyRate: 65, timeline: '1 to 3 months' },
})
 
const { applicationStatus } = await uphunt.status(queueId)

Python

uphunt.py
import os
import httpx
from typing import Literal, Optional
 
Timeline = Literal[
    "Less than 1 month", "1 to 3 months", "3 to 6 months", "More than 6 months",
]
 
class UpHunt:
    def __init__(self, api_key: Optional[str] = None, base: str = "https://uphunt.io"):
        self.client = httpx.Client(
            base_url=base,
            headers={
                "Content-Type": "application/json",
                "x-api-key": api_key or os.environ["UPHUNT_API_KEY"],
            },
            timeout=30,
        )
 
    def apply(self, *, job_id: str, cover_letter: str, profile_id: Optional[str] = None,
              hourly_rate: Optional[float] = None, timeline: Optional[Timeline] = None):
        payload = {
            "jobId": job_id,
            "coverLetter": cover_letter,
        }
        if profile_id:
            payload["profileId"] = profile_id
        if hourly_rate or timeline:
            payload["proposal"] = {
                **({"hourlyRate": hourly_rate} if hourly_rate else {}),
                **({"timeline": timeline} if timeline else {}),
            }
        r = self.client.post("/api/auto-apply-v2/apply", json=payload)
        r.raise_for_status()
        return r.json()
 
    def status(self, queue_id: str):
        r = self.client.get(f"/api/auto-apply-v2/status", params={"queueId": queue_id})
        r.raise_for_status()
        return r.json()

Usage:

from uphunt import UpHunt
 
client = UpHunt()
result = client.apply(
    job_id="~01abc123",
    cover_letter="Hi, I would love to help...",
    hourly_rate=65,
    timeline="1 to 3 months",
)
print(result["queueId"])

Raw HTTP

Works from any language with an HTTP client:

cURL
curl -X POST https://uphunt.io/api/auto-apply-v2/apply -H "x-api-key: $UPHUNT_API_KEY" -H "Content-Type: application/json" -d '{"jobId":"~01abc123","coverLetter":"..."}'

See the Recipes page for full end-to-end examples in Go, Ruby, and PHP.

On this page