GithubHelp home page GithubHelp logo

cstrnt / notion-api Goto Github PK

View Code? Open in Web Editor NEW
276.0 7.0 30.0 241 KB

Unofficial Notion.so API

Home Page: https://www.npmjs.com/package/notion-api-js

TypeScript 100.00%
notion nodejs api-client api-wrapper

notion-api's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

notion-api's Issues

Invalid Input when doing a getPageById

Hi,

Thank you for building this module.

getPages() returns a list of pageIds, but getPageById, for any of them, returns:

{
  errorId: '8e55a984-004f-44a3-8338-a7c68617e9e4',
  name: 'ValidationError',
  message: 'Invalid input.'
}

Any idea why? I need to be able to fetch Notion tables with an API.

Many thanks!

Cannot get expect Html

I run notion-api-js in nodejs, but I cannot get right html content

expect html is like that

<div>music-song</div>
...
and so on

but return cotent is


[ { HTML:
     '<div><h1 >Get Started</h1><p>๐Ÿ‘‹ Welcome! This is a private page for you to play around with. </p><br /><p>Give these things a try:</p><br /><br /><p style="color:undefined">Have a question?</p></div>',
    Attributes:
     { title: 'Get Started',
       slug: 'get-started',
       cover: null,
       teaser:
        'Get Started ๐Ÿ‘‹ Welcome! This is a private page for you to play around with.  Give these things a try: Have a question?',
       icon: null,
       id: '9bdfefb9-56af-4a3c-b21e-4301a99f6994' } },

so the return html content is total wrong? and I also use Token, why cannot get right html content?

my code is

// require syntax
const Notion = require("notion-api-js").default;


const pageUrl = "https://www.notion.so/2628769120ad41d998ec068d6e2eb410?v=e8e69ac68a8d483792c54541e4d8ba72"
const token = "acf60ab1255a12c6c101e5beb6b776a767c25a2339ea86f0d5ac5a9abc25cbb7c1e27f439adbd9cdae1bb717f02ccf739dc694c42c86018f7b136b81ce2bbcdda4f1abd6672489231d2f3835c16c"

const notion = new Notion({
  token ,
  options: {
    pageUrl 
  }
});

notion.getAllHTML().then(html => {
  // Your Code here
  console.log(html)
});

Didn't work

I do the setup of putting the token and userId, then ran it but got some error.
UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'recordMap' of undefined
Turns out there's no response in fetch.js. It seems something's missing.

I get "Authentication Error: Please check your token! error" message.

I used token_v2 value in F12 > Application > Storage > Cookies on Chrome.

But it says "Authentication Error: Please check your token! error". However, when I tried, getAllHTML() method seems working fine. But it gives unexpected JSON data.

Why does it show the message? What's the meaning of that?

TypeError prevents object creation.

I used the following code to run the library (of course, I used an actual token):

const Notion = require("notion-api-js");

let api = new Notion({
    token: "<some token>"
});

I end up getting a TypeError upon running:

TypeError: Notion is not a constructor

Max blocks per page?

Is there a max blocks per page set oder does Notion prohibit getting more?
I've made a length test with a long test on one page and it only gets data from the first 60 blocks.

Thanks!

Getting subpageId by pageId

getPages() only returns Pages, not Subpages. The HTML for Pages that only have Subpage links is blank.

Any way to find subpageIds by pageIds?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.