Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

yuseisui/twspaces

Repository files navigation

twspaces

Fetch Twitter Spaces metadata without your tokens

Warning This package no longer works due to changes in X (formerly Twitter) API.

Install

npm i twspaces

API

findSpaceById(spaceId: string): Promise<AudioSpace>

import { findSpaceById } from "twspaces";

const space = await findSpaceById("<spaceId>");

console.log(space.metadata);

findSpaceByTweetId(tweetId: string): Promise<AudioSpace>

import { findSpaceByTweetId } from "twspaces";

const space = await findSpaceByTweetId("<tweetId>");

console.log(space.metadata);

findSpaceByUrl(url: string): Promise<AudioSpace>

import { findSpaceByUrl } from "twspaces";

const spaceBySpaceUrl = await findSpaceByUrl(
  "https://twitter.com/i/spaces/<spaceId>"
);

const spaceByTweetUrl = await findSpaceByUrl(
  "https://twitter.com/<screenName>/status/<tweetId>"
);

getLiveStreamMetadata(mediaKey: string): Promise<LiveStreamMetadata>

import { findSpaceById, getLiveStreamMetadata } from "twspaces";

const space = await findSpaceById("<spaceId>");

const liveStreamMetadata = await getLiveStreamMetadata(
  space.metadata.media_key
);

console.log(liveStreamMetadata);

License

MIT License

Related

About

Fetch Twitter Spaces metadata without your tokens

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

  •  

Contributors 2

  •  
  •