PythonでBitcoinの過去データ(OHLC、価格)を取得する(CryptoWatch)

Pocket

Pythonでビットコイン(Bitcoin)の始値、高値、安値、終値といった過去データを取得するサンプルコードです。

今回はCryptoWatchからビットフライヤー(bitflyer)のビットコインの1時間足の過去データを50時間分取得します。

サンプルコード

 

解説

パラメータの”periods”には期間を指定します。単位は秒のため、1時間の場合、3600秒となり、今回は”3600″を指定しています。

パラメータの”after”にはUnixTimeを指定します。ここで指定した日時以降の過去データを取得します。今回は50時間前の時刻を指定しています。

※”after”の代わりに”before”を指定した場合、指定した日時以前の過去データを取得できます

取得した過去データはJSON形式のため、json()関数でエンコードして辞書型に変換します。変換後の辞書データから”result”(取得結果が入っています)から対象の時刻”3600″(1時間)のデータを取得します。

詳細については公式ドキュメントをご参照ください。

CryptoWatchの公式ドキュメントはこちら

「PythonでBitcoinの過去データ(OHLC、価格)を取得する(CryptoWatch)」への68件のフィードバック

  1. Good day! I could have sworn I’ve been to this site before but after reading through some of the post I realized it’s new to me.
    Anyhow, I’m definitely happy I found it and I’ll be bookmarking and checking back often!

  2. I am really enjoying the theme/design of your web site.
    Do you ever run into any browser compatibility problems?
    A few of my blog readers have complained about my blog not working correctly in Explorer
    but looks great in Safari. Do you have any tips to help
    fix this issue?

  3. Thanks for the good writeup. It if truth be told was a entertainment account it.
    Glance complex to more brought agreeable from you! However,
    how could we keep up a correspondence?

  4. After I originally commented I appear to have clicked
    on the -Notify me when new comments are added- checkbox and
    from now on whenever a comment is added I receive
    four emails with the same comment. Is there a means you can remove me from
    that service? Kudos!

  5. Excellent way of telling, and pleasant piece of
    writing to obtain information concerning my presentation subject, which i am going to convey in college.

  6. When I initially left a comment I seem to have clicked on the -Notify me when new comments are added- checkbox and from now on every time a comment is added I
    get four emails with the same comment. There has
    to be an easy method you are able to remove me from that
    service? Thank you!

  7. Every weekend i used to pay a visit this site, because i wish for
    enjoyment, for the reason that this this web site conations actually good funny stuff too.

  8. These are really impressive ideas in concerning blogging.
    You have touched some fastidious factors here. Any way keep up wrinting.

  9. Admiring the time and effort you put into your site and detailed
    information you offer. It’s good to come across a blog every once in a
    while that isn’t the same outdated rehashed material.
    Great read! I’ve saved your site and I’m adding your RSS feeds to my Google account.

  10. An impressive share! I have just forwarded this onto a coworker who was
    conducting a little research on this. And he actually ordered me breakfast because I discovered
    it for him… lol. So allow me to reword this…. Thank
    YOU for the meal!! But yeah, thanks for spending some time to discuss this
    issue here on your web site.

  11. Awesome things here. I am very glad to look your
    post. Thank you a lot and I am taking a look ahead to touch you.
    Will you please drop me a mail?

  12. I blog often and I seriously thank you for your content.
    The article has really peaked my interest. I am going to take a note
    of your blog and keep checking for new information about once
    a week. I subscribed to your RSS feed as well.

  13. Hello there! This post couldn’t be written much better!
    Reading through this post reminds me of my previous roommate!
    He always kept talking about this. I’ll send this information to him.
    Fairly certain he will have a very good read. Thank you for sharing!

  14. Hello friends, pleasant article and good arguments commented at this place, I
    am genuinely enjoying by these.

  15. Hello! This is my 1st comment here so I just wanted to give a quick shout out
    and tell you I genuinely enjoy reading your blog posts.

    Can you suggest any other blogs/websites/forums that go over the same subjects?

    Thanks for your time!

  16. We stumbled over here by a different page and thought I might as
    well check things out. I like what I see so i am just following you.

    Look forward to checking out your web page again.

  17. I do accept as true with all the concepts you have presented for your post.
    They are very convincing and will definitely work.

    Still, the posts are too brief for newbies.
    May you please extend them a little from subsequent
    time? Thank you for the post.

  18. Write more, thats all I have to say. Literally, it seems as
    though you relied on the video to make your point.
    You clearly know what youre talking about, why waste your intelligence on just
    posting videos to your site when you could be giving us something
    informative to read?

  19. We absolutely love your blog and find nearly all of your post’s to be exactly I’m looking for.

    Do you offer guest writers to write content to suit your needs?
    I wouldn’t mind publishing a post or elaborating
    on most of the subjects you write in relation to here. Again, awesome weblog!

  20. I was suggested this website by my cousin. I’m not sure whether this post is
    written by him as no one else know such detailed about my trouble.
    You’re wonderful! Thanks!

  21. Do you mind basically if I mention two of your current writes provided that I provide credit not to mention sources returning to your blog? My web business is within the identical niche as your site and my targeted traffic will have the benefit of some of the strategies and information that you offer on this page. Please don’t hesitate to tell me if it is okay for you. Thank you!

  22. Wonderful blog! Do you have any suggestions for aspiring writers?
    I’m hoping to start my own blog soon but I’m a little lost on everything.
    Would you recommend starting with a free platform like WordPress
    or go for a paid option? There are so many choices out there that
    I’m totally confused .. Any suggestions? Bless you!

  23. After checking out a few of the blog posts on your website, I really appreciate your technique
    of blogging. I added it to my bookmark site list and will be checking back in the
    near future. Take a look at my website too and tell
    me what you think.

  24. Hi! I could have sworn I’ve been to this site before
    but after going through many of the posts I realized it’s new to me.

    Anyhow, I’m definitely pleased I came across it and I’ll be book-marking it and checking back frequently!

  25. Hey would you mind sharing which blog platform you’re using?

    I’m looking to start my own blog in the near future but I’m having a difficult time deciding
    between BlogEngine/Wordpress/B2evolution and Drupal.
    The reason I ask is because your design and style seems different then most blogs and I’m looking for something completely unique.

    P.S My apologies for getting off-topic but I had to ask!

  26. You actually make it seem so easy with your
    presentation but I find this topic to be actually something
    which I think I would never understand. It seems
    too complicated and very broad for me. I am looking forward for your next post, I’ll try
    to get the hang of it!

  27. hi!,I love your writing so a lot! percentage we keep up a correspondence
    extra about your article on AOL? I need an expert on this house to solve my problem.
    Maybe that is you! Having a look ahead to see you.

  28. Please let me know if you’re looking for a writer for your weblog.
    You have some really great posts and I think I would be a good
    asset. If you ever want to take some of the load off, I’d absolutely love to write some content for your blog in exchange for a link back to mine.

    Please shoot me an e-mail if interested. Cheers!

  29. Amazing blog! Is your theme custom made or did you download it from somewhere?

    A design like yours with a few simple adjustements would really make my
    blog stand out. Please let me know where you got your design. With
    thanks

  30. Its like you read my thoughts! You seem to know a lot about this, like you wrote the e-book in it or something.
    I think that you can do with a few percent to power the message
    home a little bit, but instead of that, that is excellent blog.

    A fantastic read. I will definitely be back.

  31. Discount Bentyl 20mg Non Prescription Zyvox 600 Discount Amoxicilina With Next Day Delivery Priligy Pharmacie En Ligne Sildenafil 100 Mg

  32. That is really attention-grabbing, You are an excessively professional blogger.
    I have joined your feed and stay up for in quest of
    extra of your wonderful post. Additionally, I’ve shared
    your web site in my social networks

  33. whoah this weblog is excellent i love studying your posts.
    Keep up the good work! You know, a lot of people are searching around for this
    info, you can help them greatly.

  34. Hey There. I found your blog using msn. This is a really well
    written article. I’ll make sure to bookmark it and come back to read more of your useful info.
    Thanks for the post. I’ll certainly comeback.

  35. Thanks , I have recently been looking for info about this topic for a long time and yours is the greatest I have found out so far.
    But, what in regards to the conclusion? Are you certain in regards to the supply?

  36. Good day I am so excited I found your blog, I really found you by accident, while
    I was looking on Digg for something else, Anyhow I am here now
    and would just like to say thank you for a tremendous
    post and a all round enjoyable blog (I also love the theme/design), I don’t have time to read through it all at the
    minute but I have saved it and also added in your RSS feeds,
    so when I have time I will be back to read much more, Please do keep up the awesome job.

  37. Heya i’m for the first time here. I found this board and I to find It truly helpful & it helped me out much.
    I’m hoping to provide one thing back and aid others such as you aided me.

  38. What’s up, this weekend is pleasant in favor of me, because this moment i am reading this enormous informative paragraph here at my house.

  39. Levitra Orodispersible Rezeptfrei viagra Levitra Paiement Par Paypal Cialis 5mg Anwendung Generic Macrobid Free Consultation Bakersfield

  40. I’m impressed, I must say. Seldom do I encounter a blog that’s equally educative
    and engaging, and let me tell you, you have hit the nail on the head.
    The problem is something not enough people are speaking intelligently about.
    Now i’m very happy that I came across this in my search for
    something regarding this.

コメントは停止中です。