friendlypins.api module

Primary entry point for the Friendly Pinterest library

class friendlypins.api.API(personal_access_token)[source]

Bases: object

High level abstraction for the core Pinterest API

Parameters

personal_access_token (str) – API authentication token used for secure access to a users’ Pinterest data

get_board_by_id(board_id)[source]

Locates a specific Pinterest board given it’s internal identifier

NOTE: this API assumes that the ID provided references a valid board. If it does not, the object returned will be invalid and any attempts to access data from the board will result in an error.

Parameters

board_id (int) – the unique identifier for the board

Returns

reference to the Pinterest board

Return type

Board

get_pin_by_id(pin_id)[source]

Locates a specific Pinterest pin given it’s internal identifier

NOTE: this API assumes that the ID provided references a valid pin. If it does not, the object returned will be invalid and any attempts to access data from the pin will result in an error.

Parameters

pin_id (int) – the unique identifier for the board

Returns

reference to the Pinterest pin

Return type

Pin

property rate_limit_refresh

Gets the time when the next refresh for API queries takes effect

Type

datetime.datetime

property transaction_limit

Gets the total number of transactions per hour we’re allotted

Type

int

property transaction_remaining

Gets the total number of transactions per hour we’re allotted

Type

int

property user

Gets all primitives associated with the authenticated user

Type

User