Macrocosmos API & SDK Usage examples for SN13 Data Universe
- Grab your API key from Account Settings > Api Keys
- First 5$ of credits is on us, when you register
- Put this into your environment or a
.env
file
The official python sdk:
pip install macrocosmos
It's also available for typescript:
npm install macrocosmos
You can find examples under the examples/
directory of this repository.
Feel free to copy/clone them and use, or, get inspired by them and move on as you wish.
Right now, the examples contain sample code to use:
-
The Real Time OnDemand API: pulling up to 1000 unique tweets per datetime (up to minute precision) matching your filters (usernames, keywords, hashtags, etc), including impression data (likes, retweets, etc)
-
The Async Offline "Jobs" (or "Gravity Jobs"), which is identical to the jobs creation UI on the constellation platform, where you can pull massive amounts of data, after waiting for a couple of hours for the scraping to finish.
Currently, we support the following sources:
- X
- YouTube (Beta)
and there are plans to expand this list to also include real time web search and others
If you do not want to mess with the SDK but only want to see how your data will look if you download parquet files (through UI or SDK), check the examples/sample_data
directory.
We also provide a LLM.md
file that contains vibe coding instructions if you wish to use a co-pilot for this.