title: Future News account API in Python: user info description: Use client.account.user_info to fetch the signed-in Future News user profile from Python. Requires an auth token.
Account: account.user_info¶
Fetches the profile of the signed-in user.
| HTTP | POST https://future.news/account/user_info (empty body) |
| Auth | required: FutureNews(auth_token=...), see Authentication |
| Returns | ApiResponse |
Example (sync)¶
import os
from futurenews import FutureNews, AuthenticationError
with FutureNews(auth_token=os.environ["FUTURENEWS_TOKEN"]) as client:
try:
print(client.account.user_info().data)
except AuthenticationError:
print("Token expired: get a fresh one and build a new client.")
Example (async)¶
import asyncio, os
from futurenews import AsyncFutureNews
async def main():
async with AsyncFutureNews(auth_token=os.environ["FUTURENEWS_TOKEN"]) as client:
print((await client.account.user_info()).data)
asyncio.run(main())
Personal data
The response contains your account details. Don't paste it into public issues or logs.
Equivalent request¶
curl -X POST 'https://future.news/account/user_info?from_app=future-web&os=web' \
-H 'authorization: Bearer <token>' -H 'content-length: 0'
About the response
Future News does not publish a schema. The library returns the payload as an ApiResponse: .data holds the "data" field (or the whole JSON when there is none) and .raw always holds the untouched JSON. Unknown fields are never dropped. Field-level models are added once sample responses are confirmed, so treat the shape as subject to change.
Related: Authentication · Errors & Cloudflare · All endpoints
Don't have a Future News account?
Sign up with our link. It's free for you and supports this library.
Build something with this data
Chipa dev team builds trading bots and tools: Bot development · ChipaX exchange · Chipa Editor · Discord