Skip to content

Rewrite client for ThreatExchange API from scratch#1927

Open
jiefugong wants to merge 1 commit intofacebook:mainfrom
jiefugong:jg/threatexchange_api_rewrite
Open

Rewrite client for ThreatExchange API from scratch#1927
jiefugong wants to merge 1 commit intofacebook:mainfrom
jiefugong:jg/threatexchange_api_rewrite

Conversation

@jiefugong
Copy link
Contributor

@jiefugong jiefugong commented Feb 4, 2026

Summary

This work is being done during the Initiate Hackathon - a lot of changes are still needed!

Rewrites the client for ThreatExchange's public API from scratch. In this PR, we have the following:

  1. Adds a core.py file which contains the implementation for the client
  2. Adds a models.py file which contains some definitions of objects that one can interact with in the API

The models.py file is NOT fully vetted for correctness. As each API implementation is filled out, we will modify / create and verify the models that are associated with that API endpoint. In this PR, we implement a basic endpoint for demonstration (get_members())

Test Plan

Follow the README.md - set up a virtual environment and download required packages. Set up local access token for RF Test application. Afterwards, you can run the following:

from fb_threatexchange import ThreatExchangeClient

client = ThreatExchangeClient()
members = client.get_members()

@jiefugong jiefugong requested a review from Dcallies as a code owner February 4, 2026 00:16
@meta-cla meta-cla bot added the CLA Signed label Feb 4, 2026
@github-actions github-actions bot added the python-threatexchange Items related to the threatexchange python tool / library label Feb 4, 2026
Copy link
Contributor

@Dcallies Dcallies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This library is written as though it is going to be a standalone package. Currently the threatexchange client is distributed as part of threatexchange.

Can you talk through why you think distributing it is a standalone package is preferred?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed python-threatexchange Items related to the threatexchange python tool / library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants