← volver

Trabajo f4dae4095b32

URL: https://www.youtube.com/watch?v=CIRrRzN-dvY

Metodo: rapido  |  Idioma: original

Estado: done

Resultados:

Vista previa (transcripcion.txt)

[00:00:07] So, welcome to the Global Network webinars. So, my name is Alexander Loschke, and I will be moderating this webinar today, together with my colleague Yusi Sang.
[00:00:21] Today we have with us Mario Triani from the UN Food and Agriculture Organization, or FAOGW, who will talk about FAUSTAT, the FAUSTAT developer portal, programmatic access to FAUSTAT. API for data analysis and automation.
[00:00:46] During the webinar, the FAOGW Statistics Division will introduce the new FAOGW Stat developer portal, which is designed to provide programmatic access to FAOGW Stat data sets. The session will also cover what APIs are and how they can be used.
[00:01:06] With practical examples in Python and R, and will also showcase how the API can support AI-powered tools, making Fauerstat data more accessible and easier to integrate into analytical workflows. Let me now introduce our speaker. So Mario is the lead software developer,
[00:01:33] or is a lead software developer at FAOGW Statistics Division, where he leads the design and development of the statistical data platforms and web services that Deliver false agricultural and food data.
[00:01:53] His work focuses on building and maintaining the systems and APIs that make the data accessible and easier to integrate into analytical workflows. Before I hand over to Mario, just a few remarks. So you can write your comments and questions into the meeting chat at any
[00:02:16] time. But during the Q&A session, it would be nice if you could ask the question yourself. This makes everything a little bit more Lively.
[00:02:30] As always, this Global Network webinar is being recorded and will be made available on the Global Network of Data Officers and Statisticians on LinkedIn, and I will share the link to this in a few seconds.
[00:02:47] So in case you haven't joined the Global Network yet, we invite you to follow then the link in the chat and to join the group on LinkedIn. And please also sign up for our newsletter following then the other link in the chat to ensure that you
[00:03:05] get your monthly updates about the global network. And now over to Mario. Mario, the floor is all yours. Oh, thank you. Let me, sure. My screen. Yes.
[00:03:27] I hope everyone can see this. Okay. Okay. Good morning, good afternoon, everyone, depending on where you're joining from. My name is Mario. As Alex said, I'm the lead software developer in the statistics division here at FAO, and I'm the person who built the
[00:03:46] developer portal we are going to look today. Before we start, one thing, this session is not only for developers. It's if you ever downloaded a CLV from somewhere, especially for Fastat, and you had to download it again in three months later because the data has changed,
[00:04:05] because you want to do some changes, this session is for you. From here, we start from zero and we look real code in Python and a little bit snippet that everyone usually find useful, which is in Excel.
[00:04:21] And we talk about how also to connect this to AI tools. Question now, of course, will be at the end of the presentation. So the agenda is divided in eight blocks. First is how itself, because somebody might not know what
[00:04:40] that we're talking about, and just in just one slide, and then we have three ways that we can get the data from it, and we will see that. Then we have what is an API, what our API is, and how to use them. The 4th is how is...
[00:05:01] Sorry, the third is how the programmatic access is is useful to have reproducible workflow and use and integrating your current workflow. The 4th is how the fast APIs actually works, so it's a little bit more technical,
[00:05:16] how the requests look like, how to authenticate, where your costs come from, and so on. In the 50 real code examples in Python, R, and Excel, we will use the power query and you will see exactly the same query in all the
[00:05:32] three examples. So, it can what you prefer to what your language you prefer here. We have the developer portal. I believe it will show the developer portal itself. of the tokens, how to use the query builder,
[00:05:45] the documentation, you can see a small like them of the what we have there.
[00:05:52] At the 7th, we have first up in how to integrate this with AI powered tools, how to make use of that with user assistant or agents. And then of course, finally, we will have to how to actually use that or where to start and through questions
[00:06:10] that often come up and how to get in contact with us.
[00:06:15] So, for those who doesn't know about it or new to it, this is what is Fastet. Fastet is the false corporate statistical database. It's been online since 1996, and it's the largest database in the world. It's also one of the largest that we host
[00:06:34] here in a in a FAO. We have more than 65 statistical domains, over a million statistics covering 5 decades, 245 countries and territories, and about two and a half million visits per year. And then that, of course, is are free to use.
[00:06:53] The main organized in thematic groups, we have production, trade, which are the biggest. We have the food balances, the prices, food security, nutrition, land inputs, and emission, forestry. I mean, yeah,
[00:07:08] many that sets new domain are the often. Two things for today: most of them are called from countries with harmonized definition customs in international standards. means that we also have metadata for each domain that we are going to use and API
[00:07:27] expose them as well. API actually, you can recreate the entire website using API if you wish to do so.
[00:07:37] So, currently, before TalkBI, we let's say how to you can get information data from Fastnet. Currently, you have the website, so you can, it's probably the one that everybody that used that before it knows.
[00:07:51] You go to the website, pick a domain, you filter your information, you download the CSV or an Excel file, you also get Chart, legal briefs, and country profiles is what most of the people use in spite of exploring, and if you have one-off question,
[00:08:10] you have to get a quick look, but also a lot of people use bulk downloads. Bulk loads means that every domain is on a complete zip file. Refresh it that every release when you need to new, you need to everything that or works just offline.
[00:08:28] And then we have the new way, let's say, the API, the third door. The one URL gives you exactly 1 slice that you asked for. And the same request can be run on a script, can be used on a workbook, on AI tool, and is best for pipeline and dashboard.
[00:08:47] And if you want to do that again and again and again. Same data, same codes, same metadata behind all three. Nothing you learn on the website is wasted when you move. Through APIs. So, let me start with the word itself. What is an API?
[00:09:06] API stands for Application Programming Interface, and the definition on this slide is the only one you need. It's a way to program what you the way to program to ask a service for data instead of one person clicking on it. If you look at this four boxes,
[00:09:24] this is the typical request that that you have through the website. So you look at the four boxes, you check the option that you need. And for example, here you can see what is production of wheat in India.
[00:09:44] and you then click the selection and the request, the request is means that is what we call the domain name, QCL. You check the area, the item and the year. The first API is reserved that address, filters database, touched metadata,
[00:10:02] sends back a response. which is structured in JSON or CSV, it depends on, or even Excel, and it's ready to be used on R, Excel, or whatever you need. So basically, if you need to remember one sentence from this particular slide,
[00:10:21] this an API is for us in Fast at an URL that you query and get information from. The analogy is like a restaurant, you sit down, there's a menu, you wait for the plate. The API is the kitchen door. You have the handwritten what you want
[00:10:36] and you get exactly a support every time in this informant. Same kitchen, same food, but the 2nd way can be repeated, scheduled and automated. It's not every single time you order for your favorite is still your favorite.
[00:10:52] Okay, why we want, why we would like to have programmatic assets? The one on the left is the workflow that most of us know. It means that you navigate the website, search data set by data set, area by area,
[00:11:09] year by year, you download the CSV, the Excel file. When you, when Mustafa publishes an update, you go back and load it again, you reuse it for your current workload.
[00:11:21] Nobody can rerun the steps. I mean, technically, this way to rerun the steps, but let's say that nobody can rerun the steps because they involve manual clicking and manual work. And it's boring, let's say.
[00:11:34] Perhaps it's something that can be done in a better way. On the right here, you can see the The same work through APIs is 1 structured request, which is exactly like I click on the same boxes to click on the same buttons.
[00:11:53] And as output, you have a machine readable JSON or a CSV. It's scripted, it's automated. Its version can be reproduced or produced through pipelines and it's automated. It means that in one year time you will run it again, it will work.
[00:12:11] Our colleague will run, it will work. Some things happen, it will work again. It plugs natively also in your workflow, the tools you already use. like we said for Excel. But if you're going to use this written
[00:12:25] at the bottom, you have a country dashboard that refreshes automatically every time Fast App publishes an update, and you don't need to download or re-upload or do whatever you need to do again and again and again.
[00:12:42] So, how fast that APIs are built?
[00:12:50] On this slide, you can see that we will see the exact endpoints, so it means that there's an URL that you will have the request, stable, uniform, all across hosta domains with the full metadata also available. Everything is available as an API
[00:13:07] endpoint. The response of cached means that, if I request, if a person had the request done before you, means that that results is saved somewhere and it can be used. That means that there's no way to have another request and the...
[00:13:29] The result is very, very fast. Another thing incredibly fast is the authentication tokens are verified, let's say, at age using a lambda at age technology means that in about 1 millisecond you will not if.
[00:13:45] you're allowed to do the request or not. and it's working pretty well for our cases. And the access to those APIs are through our personal token. The personal token are free, self-service, and valid from one hour to five days.
[00:14:02] If you're not a developer, the last line is what you need to know is everything. is the same URL and keeps working. The only thing you need to manage is to get the permission to get this information from the portal.
[00:14:19] So, how to do a request though? Let's see. The structure is here. So every request looks like this line on the top. You have the URL, so the endpoint, which is called file. services.org. Then you have the API, version one,
[00:14:37] which is the current version of API we have. And then you have the language. English, French, Spanish, Chinese, Russian, and Arabic are supported. And so that you desire to have this information in a particular language that
[00:14:52] works for you, the labels will change. Obviously, only the labels will change, not the data. Then you have the type of information you want. It can be download, metadata box, unload, but even more.
[00:15:08] Then you have the domain code. Mostly the most tracked, this is a general structure that we use, but some cases it might be slightly different. You will see from the portal itself, the developer portal itself. But mostly of the request will also
[00:15:25] request you to know which domain, which data sets you want to know. Just using the domain code, so means that. If you want from crops or livestock, you have to specify QCL, FBS for balances, and RL for land use. Then you have to start filtering,
[00:15:45] so once you type the domain, you have the filter.
[00:15:51] The filter can be differentiated between each domain, but in general, you use that area, item, element, and year. It means that you have array of countries, item, element, and use the same code in every fast that you download.
[00:16:11] element and item can change based on the type of domain you currently want information from. But more or less, let's say that this is the general way to get information. In the orange box below, you can see that every
[00:16:30] Uh, every request needs our token, we'll see that in a minute, and... Means that if you're getting back four and 401 means authorize means that you didn't pass the token that it didn't defy you. It's not an error.
[00:16:48] It's just the API telling you that it doesn't know who you are. In the for example, we'll see how to this is. Just one line of code, basically. One tip that I usually say to developers and enthusiasts that once you check this
[00:17:05] information is to filter by year, because you will see lots of that sets. I mean, the requests can be pretty large and the results can be pretty large as well, so at least you have some results. Slice it by here.
[00:17:23] So, let's see how to do our request. This is an actual request. So from left to right, we can see that this in English. We want data. We want the QCL, so a crop lab stock production domain. We want India,
[00:17:41] so we use file stack code currently in the file stack API, so it's not M49. And we want to eat. in the production in a single year and the response. This is also important. Currently, we accept the JSON response output type
[00:18:01] and CSV. So it means that you can also download directly that you that you currently need. What you see below is the is what's coming back. A modeled method block that says you the processing time and the type of output
[00:18:18] you want you requested. And then the data array, where every row, this is obviously is an exact every row shows you part of the data that you requested. This is exactly what you see in the FowStart website.
[00:18:34] It's exactly the same way, exactly the same thing, but this is a... For them, you will have a for the map where you can look over and over again.
[00:18:45] So, the most common question we get is, okay, it's fine, but we have lots of code here. How do I know that India is 100 and with is 50?
[00:18:58] So, we have to raise. In the developer poster, you can have the query builder, you pick your domain, your app, your domain countries, every item, elements, and everything you need, and the URL code is generated for you.
[00:19:16] It's a starting point that is pretty okay. You also have the middle endpoint, so it means that if you get you want to information from a domain, you get everything that you need just for that, the URL structure, the type of information,
[00:19:32] the number of dimension, the dimension, the nodes, it's not machine readable output of course, so it means that. one script, you can log it in into your software logic and we will see that is important also for AI and AI section.
[00:19:50] And another thing that I usually say is just check what the files that website does. We have a definition of starting standard on every domain, means that codes are there. You can just read, use, and try. About the use and try, one advise never.
[00:20:09] guess the codes because of there, because guessing doesn't mean that you will get the information you want and more importantly, never let AI to guess them either. It's not good. So, let's see the real code.
[00:20:29] That starts with Python.
[00:20:33] So, it's exactly the same query that we said before, so it's India production for week for 2022, and this is Python. As you can see, there's no package installed. URLLib and JSON just are standard with Python. Means that in 13 lines,
[00:20:53] you have everything that you need to download your information. As you see here, we also have the... Adders means that you have to paste your token. The token is taken from the website from the developer portal.
[00:21:11] This also ways to automatize this information, so you can get automatically. There's an API to get the token, so you don't need to. To have anything else, and then you have the request call, and the data becomes an array here.
[00:21:33] From here, you can get Pandas.frame, that to give you a table, whatever you like, whatever you want, basically. From here, you can just use the information as you want. And we also have one open source package coming from a university
[00:21:53] in Italy that is published on PYEI. It's called Faster. If you prefer a wrapper to just do your things in a less manual way. Just probably everybody knows that. It's just good practice to keep the token out of your code and never disable TLS
[00:22:20] verification. And just, that's good practice, let's say. So, let's move to the next language, which is R. I'm not an R expert, but I checked with colleagues that are way more capable than me, and basically this is the way to use R for from fast APIs.
[00:22:45] This again is from the environment. From then, from the environment, we have the base URLs variable, the pipeline, so request the parameters is the exact query that we saw again and again. The response body goes through the rest
[00:23:01] body JSON with simplified vector true, and you get the data frame straight away. ready to use to whatever you prefer. If you prefer CSV, output type equals CSV. And even in this case, you will have a package called Castro
[00:23:20] from an independent developer is also available on RAM. But I want to highlight that seven point, same parameters, same program, different language.
[00:23:34] And now, the thing that usually gets most reaction from the developers, Excel, with no audience required, just our query which is built inside Excel, and here is the whole query. Yeah, the token again, the URL.
[00:23:53] the either that with the authorization bearer token, web contents to fetch. And.
[00:24:02] PSB2 document to parse, promote that needers. In just 9 lines of code, you have everything that you want, that you need for get your information directly from the APIs right to Excel. And it's usually very simple; you can obviously have, I mean,
[00:24:22] we are not limited for just those 3 languages; you can build everything you need, everything you want in your favorite language, but the important thing is everything is coming from the development. In the developer portal, like we said, we have token management, the building,
[00:24:41] the query builder, then point augmentation with all the endpoints, all the parameters, mission code, some ready to use snippets that you just saw. What's all that systems tabs in case there's a problem of connectivity,
[00:24:55] you can. Tell, um, exactly, exactly where it is. So, um... Okay, let me show you what the developer portal looks like. So from here, you can see that you have the welcome page, where you can see the system status, libraries and ecosystem with direct link
[00:25:22] from here. Is the way that you, the small pages that you can get the personal access token, you can copy that. And some snippets to just use is this. is another example of the same query again and again.
[00:25:40] Then you have the pre-builder, where you can create your own query here. Let's do something different with trade.
[00:25:54] The query might not get sense, sometimes it doesn't. But in here, you have the direct endpoint to get this information. And colleagues found the Excel snippet very useful here, where you can, we also have your token ready to use here. Just copy and paste.
[00:26:15] And also the API documentation, where you can get all the information. There's also interactive documents where you can get all the information, you can test it, you can try it. And also open API specification in in case you need.
[00:26:36] Okay, let's go back to a little bit numbers because we are still the statistic division, so we want to see some statistics. Those are the updated this morning. Since the launch, we relaunched it recently this year and
[00:26:54] we had 1500
[00:26:57] More than 1000 users that have done at least one authenticated calls API means that they've tried to use API at first, 2. 7 million API requests since the launch, 99 API requests per week, and currently we have more or less.
[00:27:17] Ten percent of all the requests in Fastat are going through APIs.
[00:27:24] Okay, probably this is the... section of this workshop where we get more excited about, which is how to use Fastat and AI powered tools means that how do I get information directly from Fastat APIs to my API power tools.
[00:27:47] So, the flow loop looks like this. Someone asks the question of plain language. How did web production in India change from 2025 to 2022? And I assistant understand the question, looks up the code, looks the metadata, writes the request.
[00:28:06] Fast APIs return the official figures with flags, units, and everything. The assistant copies the trend, draft the charts, cite the sources.
[00:28:16] The 2 bugs below are the division of the labour. This is the core of the message section and the way the AI is good at. Turning question into the right domain, filters and code. Writing with Python or our query.
[00:28:32] They will do that for you. The numbers come from some models memory, and the codes are resolved and gets real metadata, not guessed, and every answer can be traced back to a reproducible URL. It's that you have your exactly your
[00:28:47] question that you want. Language models are excellent writing queries and terrible and remembered numbers. Try to guess, try to use your favorite tool to let them guess a number. The API is the piece that keeps the AI answer correct, honest.
[00:29:06] Okay. Oops. Let's see how to do that. So we have three patterns from simple to advanced, let's say. One is the previous system, you ask the plain language, you get URL codes back from the snippet, works today in NChat Assistant,
[00:29:24] but the API structure from next slide. Uhh... And you will have.
[00:29:32] a conversation and ask. It's good for non-programmers. You just ask them, use this structure to get information and you will allow the results. The second is an agent with a tool. It means that API expose it as a tool and a system can call itself through a
[00:29:51] functionality called Model context parallel protocol MCP. The system fetches the information and answers the real figures. There's already a project that exists that uses FastData, like FastMCP that you can find on GitHub
[00:30:07] that is built from one colleague from the statistic division. And also the link is also available on the developer portal. And the portal makes it easy because they are rather stable, the scheme is stable,
[00:30:23] nothing will change and they can keep use that again and again. Then you also have, like, let's say the expert level, automated analysis. You schedule a pipeline that pulls data through API, through a language model,
[00:30:38] writes a narrative, country briefs, and other checks, and new releases, multi-language summaries, but... you will use the same URL, same results, same more or less same thing. Three ground rules for everything, alter the three patterns.
[00:30:53] Codes come from the middle of the endpoint, never from the model memory. Token stays on the server side, never in the prompt, and every number AI generated should be checked. And there should also the request that comes from and through the AI models
[00:31:10] should be checked as well, because this is a great tool, but we still have to manually check this information.
[00:31:20] Okay.
[00:31:23] Let's move to the, yeah, this, sorry. This is a schema that allows you to... to use the pattern. So you can copy and paste this information directly to the AI agent or AI assistant that you're using. Means that he has the information to do the query themselves.
[00:31:47] You just need to pass them the token. So, on the right, you have the interaction between you and the AI.
[00:31:59] Mobile. And this is described, this describes the way that you should ask the information that is coming from directly from the MCP. So, you have like a comparison, for example, between India and Pakistan for production week.
[00:32:19] in five years? The answer should be a short comparison with official figures, units, flags, and the two URL requested, one from India and one from Pakistan.
[00:32:32] The last part is the difference between the AI answer you can trust and you cannot, in the sense that here you're playing directly the information, you are not letting the AI agent trying to guess it.
[00:32:46] I'm sorry for the jump, but this was supposed to be at an earlier stage. So, from... Those colleagues that and users, we have very quickly the question that we get every time. So the API is public, yes, the API is public and free.
[00:33:05] The personal token is taken from the portal and sharing the portal with our institution is encouraged. Actually, you can get all the information you need in there. Formats are JSON and CSV. They're stable. Excel output is experimental at this
[00:33:22] moment. They're testing it. We have ready-made libraries, like we said. All domains are covered. Like I said, everything is covered in the files that APIs. You can rebuild the entire website itself if you want.
[00:33:39] The query size limits currently, we don't have an account, but please get all the information you need. If you need bigger information, bigger chunk of data, you can use the back downloads. And this might change in the future if you see,
[00:33:55] if we will see that this will be exploded. And more importantly, you can request feature help and everything. Yes, we have a feedback system in the portal to just get information. And we also have an e-mail to get the
[00:34:15] information. So to wrap up.
[00:34:21] If you want to try this today, tomorrow, those are the five steps that you sign in to the developer portal. You generate the token, you pick it, you start to use it. You can use to the query builder, query builder as you see as just there, just a copy and paste. And you can.
[00:34:40] also start to using that right now through Excel. And then we probably want to automate it. So I mean that this just can be script, refresh the workbook, you plug it into your actual, basically the limit is yours, that you can just do reasonably whatever
[00:35:00] you want. And this more or less wrap up my presentation. So thank you very much. Hope you didn't get bored. And let's go to the questions. I don't know, Alex, if you want to. Thank you, and thank you, Mario, for this great presentation about the
[00:35:24] developer portal. I would like now to invite everyone to
[00:35:34] to ask questions for that, I will actually allow cameras and microphones. So I'm just changing that right now. So anyone who wants to
[00:35:50] Ask a question, please raise your hand. That would be really nice. And then we can see. Who wants to ask something? Crowd is a little bit shy.
[00:36:08] Maybe I can start with asking one question actually. So you mentioned for using the...
[00:36:20] API, I need to generate a personal token, right? I need to sign in, generate the token, and then I can start using the API through Python or R or whatever I want to use. Is it also possible to generate this?
[00:36:39] token in a programmatic way. Maybe I missed that and yeah, please. Yeah, I can show that in the... In the in the presentation. But let me re-share my screen very briefly. Yeah, that's...
[00:36:59] Here, you can see that you can do a call. It's a different type of public. So far, we have them get URL calls. But if you can, this is the way to get the token programmatically. You have to expose your username and password. And
[00:37:18] Right to type of context, but we also have an out slash login authentication endpoint means that if you pass your username and password, you can get the information back directly. The response will be your user token.
[00:37:33] That means that with one in two calls, you can also avoid two. to do the copy and paste. Okay, the... And this is this is done to to to allow further automatization of the the workflow. Okay, thanks. Great to point this out. I see now two attendees have their hands
[00:37:56] up. Isabella, you want to come in first? Isabella works for UN Women.
[00:38:07] Hello, thanks a lot. This was really a very clear and concise explanation of how your IPA works. It's going to be extremely useful to all of us. My question is really the underlying data that one can access through this process that you develop.
[00:38:25] How often is it updated and are there specific times in the year when one should look out for sourcing it from the FAO website to get the latest information or is it just continuously being updated?
[00:38:42] This is more data related question, but I try to answer that. Let me re-share my screen once more, because in fast that we also have a release calendar. where you can get the last release and the planned next release of each domain.
[00:39:05] And you can search through it, browse it, and obviously, there's an API for that. So an API endpoint for that, you can also automatic that. and put that into your workflow.
[00:39:25] Thank you. I also see that Cody Wallace has the hand up. Cody, please come in.
[00:39:38] Great. Thank you so much, colleagues. And just first of all, huge congratulations on the launch of the developer portal here for colleagues. I think it's really impressive to see this initiative, certainly all the features that
[00:39:56] the API offers and just the robust features of the MCP, the tooling that's being offered. It's really, yeah, a huge congratulations. I think, you know, my question was really, I really honed in on the MCP workflow.
[00:40:16] And given, I mean, the where we are in the agentic AI era, if you could elaborate the just or signpost if the so is there MCP documentation available as well on the the portal platform and is this maintained by FAO or?
[00:40:39] this is community maintained, and we could potentially have contributions like pull requests and such. Yeah, and I'll leave it at that for now. But thank you again. Yeah, thank you for the question. Yeah, it's an interesting question. And yeah,
[00:40:59] we have, we don't have a... Let's say file MCP server, but there's one on available on GitHub. You can find the link on the developer port in the developer port within the libraries and ecosystem and is developed by a colleague is mostly and we will.
[00:41:21] Unfortunately, I could not have time to also show the real-time. Example for that, but I mean, it's available on GitHub and it's MIT license, so you can contribute to the code and reuse that freely. The one thing that I didn't have
[00:41:43] highlighted every the use of data in. FAO from the statistic portal is subject to the study file statistical database term of use, which is CC by 4.0. And means that, yeah, you can you can freely use that and
[00:42:03] cancel freely use the MCP that is available on GitHub.
[00:42:11] Thanks so much. Thank you. Thanks. I see also, I see Javier on the camera and Javier has put a question there also in the chat. Javier, you want to please ask it?
[00:42:30] Sure. Thank you, colleagues. Greens from Brasilia. Thank you, Mario, for the very nice presentation, the step by step. For some of us that we are not very exposed to do the APIs frequently, it's always like a new discovery every single time a line of code comes into the
[00:42:45] screen in a presentation. My question is very simple. Can this be also created on a Stata?
[00:42:54] Yeah, of course, I mean, you can create in any language you want. The endpoint is, I don't know, it's not very well, but there's for sure a way to ask information through our website. Once more, use the same endpoint, and the same endpoint is always the same.
[00:43:13] You do the query in there, you get the information, then you can manipulate in any language you want, basically. You can. Yeah, of course you can do it.
[00:43:25] Thanks so much. Any other questions, please raise your hands.
[00:43:33] Otherwise, I see also a few questions in the meeting chat, which I can read out. There's a question by Tracy. So is there also subnational data available? In Fauerstat.
[00:43:53] So I guess by provinces, regions, or something like that. And this is.
[00:43:57] This is more a question on the data than APIs. I will let colleagues that, as statistician colleague were here to answer that, but I don't recall that we have much sub-national data in Fastat, but any data that is available on Fastat is available through APIs.
[00:44:18] So, if you find that there in the website, you can find it in the APIs.
[00:44:25] Yeah. Anyone else wants to come in, please raise your hand.
[00:44:36] Otherwise, I'd take another question from the chat. So Girish Patil was asking, so some websites use bot checks to determine whether the user is a human or a bot. And now the question has moved, sorry. In such situations, how does the API work?
[00:44:59] Our API doesn't discriminate between humans or bots. Everyone is welcome. You just bring your own token. If your bot or your script has direct token, you can get information. So obviously the website gets its own
[00:45:14] token as well. It's that when you browse and use the website, every request gets a token. So it just depends on if it's human doing queries in Excel about a script that automatics get information from.
[00:45:29] Same thing, bring your own token and you'll be welcome.
[00:45:38] All right. Anyone else?
[00:45:44] Any other questions?
[00:45:52] I can also take a question from the registration form. And so there was a question, how would you recommend interacting with the API for bulk downloads, such as pulling indicators for all countries in a region. I think you have mentioned it before a
[00:46:17] little bit, but maybe you can elaborate a little bit more on that, how to do bulk requests, and if it's possible through the API. Absolutely, absolutely. So, uh... Technically, you can get all the information you want
[00:46:36] and you need from the APIs. It just is not very convenient. Means that you do the requests. For example, you get, I want all the information from one entire domain. So it means that I want all the production information through APIs.
[00:46:53] You do the request. The request gets elaborated from the server. Obviously, every request has a timeout time, means that we don't know the system. We will not know if the request is lost, still processed or processed, means that
[00:47:13] After a certain amount of time, the request will break. That means that you do the request, you wait a lot of time for machines, and then you get my information back. So we usually suggest to use bot downloads if you want to do further
[00:47:31] analysis, so big analysis, so big chunk of data sets, and obviously with an API to get all the information from bot downloads. And also the bot downloads are available, searchable through APIs. But the suggestion that we usually ask people using, if you have...
[00:47:54] or you have the need of big chunk of data sets, use the bulk to load this zip file. Even that one is cached, so it means that is available is very fast download. And you get all the information there.
[00:48:08] Actually, we have workflow that gets all the database downloaded. It's also one. A huge zip file that get that got the entire data base, so it depends on your workflow, but we suggest if you have a small,
[00:48:22] if you need small data sets frequently, use API. If you need to download big chunk of data sets, use the back download.
[00:48:33] All right. Thank you. I see Inkyung Choi has her hand up. Inkyung, please comment. Thank you. Yes, thank you very much for this very interesting presentation. I have a question around the usage data. So do you plan or are you already using the usage data?
[00:48:55] Because I guess the API could provide a more disaggregated level of usage, like for each product, for each even data format that which format of data JSON, CSV, which is more preferred, etc. And also related to the MCP. It's interesting,
[00:49:15] this community project type of MCP server popping up. And do you, as a FAO, plan to develop more official one?
[00:49:28] Okay, let me start for the last one. Yeah, we very well come and encourage a community-based project, means that there's still an interest in the work we do. And now currently for FASTA, since there's
[00:49:47] Open source tools are already available. We plan to not create our own version.
[00:49:55] Also, during the build of the David developer portal, we connected to the original developers to use the authorization token to let not break the work. We also don't want to do. the same works twice. There's an open source community that
[00:50:17] have built something that works. It's fine for us. Just follow the rules, use the token. It's good for us.
[00:50:26] Regarding your first question, I believe is more about the data itself. So unfortunately, I'm not a statistician, I'm not an expert on the data. So I believe that is more for colleagues than a statistician in FAO to answer that.
[00:50:45] I have to reply in the same way. If it's available on a FAO, that means that is available through APIs.
[00:50:54] The different level of aggregation of data sets is done before it reaches FAO, before it reaches fast that means that is also done before it reaches APIs.
[00:51:10] All right. Thank you also for this answer. Anyone else wants to come in?
[00:51:18] Please raise your hand now.
[00:51:23] Uh, yeah, Yuxi, please come in.
[00:51:28] All right, thank you, Alex, and thank you so much, Mario, for this great presentation. I think it will be really helpful to query the data in a programmatic way. And just, I'm just curious if there's like a thorough or comprehensive documentation
[00:51:45] for the API that, you know, any developer could be used, or I'm not sure if that's been. published online. Yeah, thank you. Yeah, on the developer portal, you can find a documentation tab where you can find 2 files. Let's say one is an interactive section,
[00:52:07] but you can list every single endpoint and with all the information that you need to. request for that specific endpoint and the result that you're going to expect. Also, there is what is called then a Yan file.
[00:52:25] which is written in the open API standard, means that is also that is AI ready, machine readable. It can be used to generate several automated information to be used, and every single endpoint for fast API is
[00:52:43] available there. So it means that you get, you can use that with your AI tools or just read it and try to use that in the old-fashioned way if you want. Yeah, thank you so much, Mario. Really helpful.
[00:52:59] They're great, great information also. So, anyone else last chance to ask questions?
[00:53:13] I don't see any. Well, then maybe we can conclude. I just want to mention once more, we will share the recording and the presentation slides in the Global Network of Data Officers and Statisticians. I have shared the link in the meeting chat.
[00:53:32] And before we all go, maybe we can turn on all our cameras and maybe all our microphones and give Mario a big round of applause. I think that would be really amazing. So please turn on your camera. Thanks.
[00:53:50] Thank you. Thank you all. External. What's one? Thanks. Yeah, this is always kind of my favorite moment because it shows that there are actually people sitting on the other side. And yeah, thanks everyone for joining. Please join us again next time for our
[00:54:12] next webinar. I will send out the invitation probably tomorrow, so look out for it. But the information is already available in our newsletter that we had sent out recently. And this will be about the collaborative on administrative data on the 29th.
[00:54:36] of September. So thanks again for joining. Have a great rest of your day. Thank you so much. Bye bye. Bye. Thank you all. Excellent. Thank you. Thank you, Mario. Thank you, everyone. Bye bye. Thank you. Bye bye. Thank you.
[00:54:44] Thank you. Bye bye. Thank you, colleagues. Thanks, Felipe.

Log

$ python yt_subs.py https://www.youtube.com/watch?v=CIRrRzN-dvY --idioma-destino none --salida-dir /app/output/jobs/f4dae4095b32 --salida transcripcion --formatos txt,srt,json

Fuente: transcript-api manual/en  (200 bloques)

Listo. Archivos generados:
  - /app/output/jobs/f4dae4095b32/transcripcion.txt
  - /app/output/jobs/f4dae4095b32/transcripcion.srt
  - /app/output/jobs/f4dae4095b32/transcripcion.json