https://github.com/upb-ss1/pycrowdtangle
A Python Wrapper To Retrieve Data From The CrowdTangle API
https://github.com/upb-ss1/pycrowdtangle
crowdtangle python wrapper-api
Last synced: about 1 month ago
JSON representation
A Python Wrapper To Retrieve Data From The CrowdTangle API
- Host: GitHub
- URL: https://github.com/upb-ss1/pycrowdtangle
- Owner: UPB-SS1
- License: mit
- Created: 2020-06-25T12:22:13.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2025-06-10T08:15:22.000Z (11 months ago)
- Last Synced: 2025-12-16T18:13:45.265Z (5 months ago)
- Topics: crowdtangle, python, wrapper-api
- Language: Python
- Homepage:
- Size: 30.3 KB
- Stars: 11
- Watchers: 2
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PyCrowdTangle
A Python Wrapper To Retrieve Data From The [CrowdTangle API](https://github.com/CrowdTangle/API)
[https://pypi.org/project/PyCrowdTangle](https://pypi.org/project/PyCrowdTangle/)
## Install
```
pip install PyCrowdTangle
```
### Update
```
pip install PyCrowdTangle -U
```
## Example
[](https://colab.research.google.com/github/UPB-SS1/PyCrowdTangle/blob/master/examples/pycrowdtangle_example.ipynb)
## Usage
### ct_get_posts
```python
import PyCrowdTangle as pct
#retrieve data from CrowdTangle
# get the api_token from https://apps.crowdtangle.com/
# you can locate your API token via your crowdtangle dashboard
# under Settings > API Access.
data = pct.ct_get_posts(api_token="AKJHXDFYTGEBKRJ6535")
import pandas as pd
df = pd.DataFrame(data['result']['posts'])
#show results
df.head()
```
### ct_get_links
```python
import PyCrowdTangle as pct
#retrieve data from CrowdTangle
# get the api_token from https://apps.crowdtangle.com/
# you can locate your API token via your crowdtangle dashboard
# under Settings > API Access.
data = pct.ct_get_links(link= 'http://www.queenonline.com/', platforms='facebook',
start_date='2019-01-01',api_token="AKJHXDFYTGEBKRJ6535")
import pandas as pd
df = pd.DataFrame(data['result']['posts'])
#show results
df.head()
```
### ct_get_lists
```python
import PyCrowdTangle as pct
#retrieve data from CrowdTangle
# get the api_token from https://apps.crowdtangle.com/
# you can locate your API token via your crowdtangle dashboard
# under Settings > API Access.
data = pct.ct_get_lists(api_token="AKJHXDFYTGEBKRJ6535")
#show results
print(data)
```
## Acknowledgements
CooRnet has been developed as part of the project [Social Media Behaviour](https://upb-ss1.github.io/) research project activities.
The project is supported by a the Social Media and Democracy Research Grants from Social Science Research Council (SSRC). Data and tools provided by Facebook.