carejobs

Client for the free CareJobs.Now healthcare jobs API: search US healthcare jobs, posted pay, employers and states.
https://github.com/yumaheymans/carejobs-haxe

To install, run:

haxelib install carejobs 1.0.0 

See using Haxelib in Haxelib documentation for more information.

README.md

carejobs-haxe

Haxe client for the CareJobs.Now healthcare jobs API. Search open US healthcare jobs, see the hourly pay employers post, and look up employers and states.

  • Free, no API key.
  • Standard library only (haxe.Http, haxe.Json). Haxe 4.0 or newer.
  • Callbacks, so it works the same on JavaScript (asynchronous) and on the sys targets (the callbacks run before the method returns). Checked on the eval interpreter, JavaScript and Python.
  • Typed results (typedefs), one CareJobsError class.
  • The same API is a remote MCP server at https://carejobs.now/api/mcp, so any MCP client can use it too.

Install

haxelib install carejobs

Then add -lib carejobs to your .hxml file.

Quick start

import carejobs.CareJobs;

class Main {
	static function main() {
		var client = new CareJobs();

		client.searchJobs({query: "ICU", kind: Nurses, state: "TX", limit: 5}, function(res) {
			trace(res.total + " jobs match");
			for (job in res.jobs)
				trace(job.title + " | " + job.employer + " | " + job.location + " | " + job.url);
		}, function(err) trace(err.toString()));

		client.payByKind(Nurses, function(res) {
			if (res.pay != null)
				trace("Median posted pay for nurses: $" + res.pay.median + "/hr");
		}, function(err) trace(err.toString()));
	}
}

Build and run it with haxe -lib carejobs -main Main --interp.

Methods

MethodWhat it answersResult
new CareJobs(?baseUrl)A client for the live APICareJobs
searchJobs(?params, onResult, onError)Open jobs by query, kind, state and limitSearchResult
payByKind(kind, onResult, onError)Posted hourly pay for one kind of job, and the employers posting the mostPayResult
employers(?query, ?limit, onResult, onError)The employers, AI-training programs and job boards the site readsEmployerList
states(onResult, onError)Open jobs in every US stateArray<StateSummary>
CareJobs.kinds()The 17 kinds of job (no request)Array<Kind>
callTool(name, arguments, onResult, onError)Any tool of the server, as raw dataDynamic

Every SearchParams field is optional. Kind is an enum abstract over String with the 17 kinds (Nurses, NursePractitioners, and so on); its value is the slug the API uses ("nurse-practitioners"), and Kind.fromSlug("nurses") reads one back.

Every Job carries url, its page on CareJobs.Now, where a person applies. The server has no separate job lookup by id: a job is described by the search answer.

Where the API sends null, the field is null (Job.pay, SearchResult.pay, PayResult.pay, and so on): PayResult.pay is null when too few jobs post an hourly rate to measure.

Errors and timeouts

Every failure (network, HTTP status, JSON-RPC error, a tool the server refuses to run) goes to onError as a CareJobsError with message, status (the HTTP status or 0) and tool.

On the sys targets client.timeout (seconds, default 60) limits how long a connection may wait. The server answers a query it has not seen before in up to about 25 seconds (its database may be waking up), then repeats of it in a fraction of one, so a first call can be slow.

Tests

haxe test.hxml    # offline, on answers recorded from the live API
haxe live.hxml    # the same calls against the real API

Data

Data from CareJobs.Now, CC BY 4.0. Docs and downloads: https://carejobs.now/data.

License

Code: MIT, copyright O-mega Enterprise, Inc. See LICENSE.

Contributors
carejobs
Version
1.0.0
Published
4 weeks ago
License
MIT

All libraries are free

Every month, more than a thousand developers use Haxelib to find, share, and reuse code — and assemble it in powerful new ways. Enjoy Haxe; It is great!

Explore Haxe

Haxe Manual

Haxe Code Cookbook

Haxe API documentation

You can try Haxe in the browser! try.haxe.org

Join us on GitHub!

Haxe is being developed on GitHub. Feel free to contribute or report issues to our projects.

Haxe on GitHub

⌂