Metadata-Version: 2.5
Name: foxapis-haystack
Version: 0.1.0
Summary: Haystack Toolset for FoxAPIs: sourced company, person, funding, layoff and executive-change records.
Project-URL: Homepage, https://foxapis.com/docs
Project-URL: Repository, https://github.com/OsakaSaul/foxapis-haystack
Project-URL: Issues, https://github.com/OsakaSaul/foxapis-haystack/issues
License-Expression: MIT
License-File: LICENSE
Keywords: agents,company-data,due-diligence,foxapis,haystack,tools
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.9
Requires-Dist: haystack-ai>=2.19.0
Requires-Dist: requests
Description-Content-Type: text/markdown

# foxapis-haystack

A [Haystack](https://haystack.deepset.ai) `Toolset` that gives an Agent seven tools over [FoxAPIs](https://foxapis.com/docs): sourced records about companies and people. Every answer comes back as JSON with its record links.

| Tool | What it returns |
| --- | --- |
| `foxapis_enrich_person` | Identity and contact fields for a named person |
| `foxapis_find_work_email` | The best work email at a company website, with its verification status |
| `foxapis_company_snapshot` | A short company snapshot written for one decision (runs in the background; the tool waits) |
| `foxapis_form_d_raises` | Recent private-placement raises filed on Form D |
| `foxapis_layoffs` | US layoff notices |
| `foxapis_executive_changes` | Executive appointments and departures from company filings |
| `foxapis_federal_contract_awards` | US federal contract awards |

Credits are spent from the account of your key; what each call costs is listed at https://foxapis.com/pricing . A call that finds nothing is not charged. A key with free starting credits: https://foxapis.com/trial

## Install

```bash
pip install foxapis-haystack
```

## Use

Set `FOXAPIS_API_KEY` (or pass `api_key=Secret...`). Then hand the toolset to an Agent:

```python
from haystack.components.agents import Agent
from haystack.components.generators.chat import OpenAIChatGenerator
from haystack.dataclasses import ChatMessage
from haystack_integrations.tools.foxapis import FoxAPIsToolset

agent = Agent(
    chat_generator=OpenAIChatGenerator(),
    tools=FoxAPIsToolset(tool_names=["foxapis_layoffs", "foxapis_executive_changes"]),
)
result = agent.run(messages=[ChatMessage.from_user("Which executives left Example Corp this year?")])
print(result["messages"][-1].text)
```

`tool_names` keeps only the tools you list; leave it out for all seven. To call one tool without an Agent:

```python
toolset = FoxAPIsToolset()
tool = next(t for t in toolset if t.name == "foxapis_layoffs")
print(tool.invoke(company="Example", limit=3))
```

The key is a Haystack `Secret`, so it is never written out when the toolset is serialized.

## Not for

Do not use these records to decide on credit, employment, housing or insurance eligibility.

## Develop

```bash
pip install -e . pytest haystack-ai
pytest
```

The tests mock the HTTP layer and need no key. The REST reference is https://foxapis.com/openapi.json .

## License

MIT
